diff options
Diffstat (limited to 'fs/nilfs2/recovery.c')
-rw-r--r-- | fs/nilfs2/recovery.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/fs/nilfs2/recovery.c b/fs/nilfs2/recovery.c index 3dfcd3b7d389..ba4a64518f38 100644 --- a/fs/nilfs2/recovery.c +++ b/fs/nilfs2/recovery.c | |||
@@ -425,7 +425,7 @@ void nilfs_dispose_segment_list(struct list_head *head) | |||
425 | } | 425 | } |
426 | 426 | ||
427 | static int nilfs_prepare_segment_for_recovery(struct the_nilfs *nilfs, | 427 | static int nilfs_prepare_segment_for_recovery(struct the_nilfs *nilfs, |
428 | struct nilfs_sb_info *sbi, | 428 | struct super_block *sb, |
429 | struct nilfs_recovery_info *ri) | 429 | struct nilfs_recovery_info *ri) |
430 | { | 430 | { |
431 | struct list_head *head = &ri->ri_used_segments; | 431 | struct list_head *head = &ri->ri_used_segments; |
@@ -501,7 +501,7 @@ static int nilfs_recovery_copy_block(struct the_nilfs *nilfs, | |||
501 | } | 501 | } |
502 | 502 | ||
503 | static int nilfs_recover_dsync_blocks(struct the_nilfs *nilfs, | 503 | static int nilfs_recover_dsync_blocks(struct the_nilfs *nilfs, |
504 | struct nilfs_sb_info *sbi, | 504 | struct super_block *sb, |
505 | struct nilfs_root *root, | 505 | struct nilfs_root *root, |
506 | struct list_head *head, | 506 | struct list_head *head, |
507 | unsigned long *nr_salvaged_blocks) | 507 | unsigned long *nr_salvaged_blocks) |
@@ -514,7 +514,7 @@ static int nilfs_recover_dsync_blocks(struct the_nilfs *nilfs, | |||
514 | int err = 0, err2 = 0; | 514 | int err = 0, err2 = 0; |
515 | 515 | ||
516 | list_for_each_entry_safe(rb, n, head, list) { | 516 | list_for_each_entry_safe(rb, n, head, list) { |
517 | inode = nilfs_iget(sbi->s_super, root, rb->ino); | 517 | inode = nilfs_iget(sb, root, rb->ino); |
518 | if (IS_ERR(inode)) { | 518 | if (IS_ERR(inode)) { |
519 | err = PTR_ERR(inode); | 519 | err = PTR_ERR(inode); |
520 | inode = NULL; | 520 | inode = NULL; |
@@ -572,11 +572,11 @@ static int nilfs_recover_dsync_blocks(struct the_nilfs *nilfs, | |||
572 | * nilfs_do_roll_forward - salvage logical segments newer than the latest | 572 | * nilfs_do_roll_forward - salvage logical segments newer than the latest |
573 | * checkpoint | 573 | * checkpoint |
574 | * @nilfs: nilfs object | 574 | * @nilfs: nilfs object |
575 | * @sbi: nilfs_sb_info | 575 | * @sb: super block instance |
576 | * @ri: pointer to a nilfs_recovery_info | 576 | * @ri: pointer to a nilfs_recovery_info |
577 | */ | 577 | */ |
578 | static int nilfs_do_roll_forward(struct the_nilfs *nilfs, | 578 | static int nilfs_do_roll_forward(struct the_nilfs *nilfs, |
579 | struct nilfs_sb_info *sbi, | 579 | struct super_block *sb, |
580 | struct nilfs_root *root, | 580 | struct nilfs_root *root, |
581 | struct nilfs_recovery_info *ri) | 581 | struct nilfs_recovery_info *ri) |
582 | { | 582 | { |
@@ -648,7 +648,7 @@ static int nilfs_do_roll_forward(struct the_nilfs *nilfs, | |||
648 | goto failed; | 648 | goto failed; |
649 | if (flags & NILFS_SS_LOGEND) { | 649 | if (flags & NILFS_SS_LOGEND) { |
650 | err = nilfs_recover_dsync_blocks( | 650 | err = nilfs_recover_dsync_blocks( |
651 | nilfs, sbi, root, &dsync_blocks, | 651 | nilfs, sb, root, &dsync_blocks, |
652 | &nsalvaged_blocks); | 652 | &nsalvaged_blocks); |
653 | if (unlikely(err)) | 653 | if (unlikely(err)) |
654 | goto failed; | 654 | goto failed; |
@@ -681,7 +681,7 @@ static int nilfs_do_roll_forward(struct the_nilfs *nilfs, | |||
681 | 681 | ||
682 | if (nsalvaged_blocks) { | 682 | if (nsalvaged_blocks) { |
683 | printk(KERN_INFO "NILFS (device %s): salvaged %lu blocks\n", | 683 | printk(KERN_INFO "NILFS (device %s): salvaged %lu blocks\n", |
684 | sbi->s_super->s_id, nsalvaged_blocks); | 684 | sb->s_id, nsalvaged_blocks); |
685 | ri->ri_need_recovery = NILFS_RECOVERY_ROLLFORWARD_DONE; | 685 | ri->ri_need_recovery = NILFS_RECOVERY_ROLLFORWARD_DONE; |
686 | } | 686 | } |
687 | out: | 687 | out: |
@@ -695,7 +695,7 @@ static int nilfs_do_roll_forward(struct the_nilfs *nilfs, | |||
695 | printk(KERN_ERR | 695 | printk(KERN_ERR |
696 | "NILFS (device %s): Error roll-forwarding " | 696 | "NILFS (device %s): Error roll-forwarding " |
697 | "(err=%d, pseg block=%llu). ", | 697 | "(err=%d, pseg block=%llu). ", |
698 | sbi->s_super->s_id, err, (unsigned long long)pseg_start); | 698 | sb->s_id, err, (unsigned long long)pseg_start); |
699 | goto out; | 699 | goto out; |
700 | } | 700 | } |
701 | 701 | ||
@@ -724,7 +724,7 @@ static void nilfs_finish_roll_forward(struct the_nilfs *nilfs, | |||
724 | /** | 724 | /** |
725 | * nilfs_salvage_orphan_logs - salvage logs written after the latest checkpoint | 725 | * nilfs_salvage_orphan_logs - salvage logs written after the latest checkpoint |
726 | * @nilfs: nilfs object | 726 | * @nilfs: nilfs object |
727 | * @sbi: nilfs_sb_info | 727 | * @sb: super block instance |
728 | * @ri: pointer to a nilfs_recovery_info struct to store search results. | 728 | * @ri: pointer to a nilfs_recovery_info struct to store search results. |
729 | * | 729 | * |
730 | * Return Value: On success, 0 is returned. On error, one of the following | 730 | * Return Value: On success, 0 is returned. On error, one of the following |
@@ -741,7 +741,7 @@ static void nilfs_finish_roll_forward(struct the_nilfs *nilfs, | |||
741 | * %-ENOMEM - Insufficient memory available. | 741 | * %-ENOMEM - Insufficient memory available. |
742 | */ | 742 | */ |
743 | int nilfs_salvage_orphan_logs(struct the_nilfs *nilfs, | 743 | int nilfs_salvage_orphan_logs(struct the_nilfs *nilfs, |
744 | struct nilfs_sb_info *sbi, | 744 | struct super_block *sb, |
745 | struct nilfs_recovery_info *ri) | 745 | struct nilfs_recovery_info *ri) |
746 | { | 746 | { |
747 | struct nilfs_root *root; | 747 | struct nilfs_root *root; |
@@ -750,32 +750,32 @@ int nilfs_salvage_orphan_logs(struct the_nilfs *nilfs, | |||
750 | if (ri->ri_lsegs_start == 0 || ri->ri_lsegs_end == 0) | 750 | if (ri->ri_lsegs_start == 0 || ri->ri_lsegs_end == 0) |
751 | return 0; | 751 | return 0; |
752 | 752 | ||
753 | err = nilfs_attach_checkpoint(sbi, ri->ri_cno, true, &root); | 753 | err = nilfs_attach_checkpoint(sb, ri->ri_cno, true, &root); |
754 | if (unlikely(err)) { | 754 | if (unlikely(err)) { |
755 | printk(KERN_ERR | 755 | printk(KERN_ERR |
756 | "NILFS: error loading the latest checkpoint.\n"); | 756 | "NILFS: error loading the latest checkpoint.\n"); |
757 | return err; | 757 | return err; |
758 | } | 758 | } |
759 | 759 | ||
760 | err = nilfs_do_roll_forward(nilfs, sbi, root, ri); | 760 | err = nilfs_do_roll_forward(nilfs, sb, root, ri); |
761 | if (unlikely(err)) | 761 | if (unlikely(err)) |
762 | goto failed; | 762 | goto failed; |
763 | 763 | ||
764 | if (ri->ri_need_recovery == NILFS_RECOVERY_ROLLFORWARD_DONE) { | 764 | if (ri->ri_need_recovery == NILFS_RECOVERY_ROLLFORWARD_DONE) { |
765 | err = nilfs_prepare_segment_for_recovery(nilfs, sbi, ri); | 765 | err = nilfs_prepare_segment_for_recovery(nilfs, sb, ri); |
766 | if (unlikely(err)) { | 766 | if (unlikely(err)) { |
767 | printk(KERN_ERR "NILFS: Error preparing segments for " | 767 | printk(KERN_ERR "NILFS: Error preparing segments for " |
768 | "recovery.\n"); | 768 | "recovery.\n"); |
769 | goto failed; | 769 | goto failed; |
770 | } | 770 | } |
771 | 771 | ||
772 | err = nilfs_attach_segment_constructor(sbi, root); | 772 | err = nilfs_attach_log_writer(sb, root); |
773 | if (unlikely(err)) | 773 | if (unlikely(err)) |
774 | goto failed; | 774 | goto failed; |
775 | 775 | ||
776 | set_nilfs_discontinued(nilfs); | 776 | set_nilfs_discontinued(nilfs); |
777 | err = nilfs_construct_segment(sbi->s_super); | 777 | err = nilfs_construct_segment(sb); |
778 | nilfs_detach_segment_constructor(sbi); | 778 | nilfs_detach_log_writer(sb); |
779 | 779 | ||
780 | if (unlikely(err)) { | 780 | if (unlikely(err)) { |
781 | printk(KERN_ERR "NILFS: Oops! recovery failed. " | 781 | printk(KERN_ERR "NILFS: Oops! recovery failed. " |