recovery.c (f1615bbe9be4def59c3b3eaddb60722efeed16c2) recovery.c (743162013d40ca612b4cb53d3a200dff2d9ab26e)
1/*
2 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
3 * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
4 *
5 * This copyrighted material is made available to anyone wishing to use,
6 * modify, copy, or redistribute it subject to the terms and conditions
7 * of the GNU General Public License version 2.
8 */

--- 577 unchanged lines hidden (view full) ---

586 jd->jd_recover_error = error;
587 gfs2_recovery_done(sdp, jd->jd_jid, LM_RD_GAVEUP);
588done:
589 clear_bit(JDF_RECOVERY, &jd->jd_flags);
590 smp_mb__after_atomic();
591 wake_up_bit(&jd->jd_flags, JDF_RECOVERY);
592}
593
1/*
2 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
3 * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
4 *
5 * This copyrighted material is made available to anyone wishing to use,
6 * modify, copy, or redistribute it subject to the terms and conditions
7 * of the GNU General Public License version 2.
8 */

--- 577 unchanged lines hidden (view full) ---

586 jd->jd_recover_error = error;
587 gfs2_recovery_done(sdp, jd->jd_jid, LM_RD_GAVEUP);
588done:
589 clear_bit(JDF_RECOVERY, &jd->jd_flags);
590 smp_mb__after_atomic();
591 wake_up_bit(&jd->jd_flags, JDF_RECOVERY);
592}
593
594static int gfs2_recovery_wait(void *word)
595{
596 schedule();
597 return 0;
598}
599
600int gfs2_recover_journal(struct gfs2_jdesc *jd, bool wait)
601{
602 int rv;
603
604 if (test_and_set_bit(JDF_RECOVERY, &jd->jd_flags))
605 return -EBUSY;
606
607 /* we have JDF_RECOVERY, queue should always succeed */
608 rv = queue_work(gfs_recovery_wq, &jd->jd_work);
609 BUG_ON(!rv);
610
611 if (wait)
594int gfs2_recover_journal(struct gfs2_jdesc *jd, bool wait)
595{
596 int rv;
597
598 if (test_and_set_bit(JDF_RECOVERY, &jd->jd_flags))
599 return -EBUSY;
600
601 /* we have JDF_RECOVERY, queue should always succeed */
602 rv = queue_work(gfs_recovery_wq, &jd->jd_work);
603 BUG_ON(!rv);
604
605 if (wait)
612 wait_on_bit(&jd->jd_flags, JDF_RECOVERY, gfs2_recovery_wait,
606 wait_on_bit(&jd->jd_flags, JDF_RECOVERY,
613 TASK_UNINTERRUPTIBLE);
614
615 return wait ? jd->jd_recover_error : 0;
616}
617
607 TASK_UNINTERRUPTIBLE);
608
609 return wait ? jd->jd_recover_error : 0;
610}
611