diff options
Diffstat (limited to 'fs/nilfs2/segment.c')
-rw-r--r-- | fs/nilfs2/segment.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index 91dc0668ec83..b0c5e08d06c8 100644 --- a/fs/nilfs2/segment.c +++ b/fs/nilfs2/segment.c | |||
@@ -1945,11 +1945,9 @@ static void nilfs_segctor_complete_write(struct nilfs_sc_info *sci) | |||
1945 | 1945 | ||
1946 | nilfs_drop_collected_inodes(&sci->sc_dirty_files); | 1946 | nilfs_drop_collected_inodes(&sci->sc_dirty_files); |
1947 | 1947 | ||
1948 | if (nilfs_doing_gc()) { | 1948 | if (nilfs_doing_gc()) |
1949 | nilfs_drop_collected_inodes(&sci->sc_gc_inodes); | 1949 | nilfs_drop_collected_inodes(&sci->sc_gc_inodes); |
1950 | if (update_sr) | 1950 | else |
1951 | nilfs_commit_gcdat_inode(nilfs); | ||
1952 | } else | ||
1953 | nilfs->ns_nongc_ctime = sci->sc_seg_ctime; | 1951 | nilfs->ns_nongc_ctime = sci->sc_seg_ctime; |
1954 | 1952 | ||
1955 | sci->sc_nblk_inc += sci->sc_nblk_this_inc; | 1953 | sci->sc_nblk_inc += sci->sc_nblk_this_inc; |
@@ -2472,13 +2470,15 @@ int nilfs_clean_segments(struct super_block *sb, struct nilfs_argv *argv, | |||
2472 | 2470 | ||
2473 | nilfs_transaction_lock(sbi, &ti, 1); | 2471 | nilfs_transaction_lock(sbi, &ti, 1); |
2474 | 2472 | ||
2475 | err = nilfs_init_gcdat_inode(nilfs); | 2473 | err = nilfs_mdt_save_to_shadow_map(nilfs->ns_dat); |
2476 | if (unlikely(err)) | 2474 | if (unlikely(err)) |
2477 | goto out_unlock; | 2475 | goto out_unlock; |
2478 | 2476 | ||
2479 | err = nilfs_ioctl_prepare_clean_segments(nilfs, argv, kbufs); | 2477 | err = nilfs_ioctl_prepare_clean_segments(nilfs, argv, kbufs); |
2480 | if (unlikely(err)) | 2478 | if (unlikely(err)) { |
2479 | nilfs_mdt_restore_from_shadow_map(nilfs->ns_dat); | ||
2481 | goto out_unlock; | 2480 | goto out_unlock; |
2481 | } | ||
2482 | 2482 | ||
2483 | sci->sc_freesegs = kbufs[4]; | 2483 | sci->sc_freesegs = kbufs[4]; |
2484 | sci->sc_nfreesegs = argv[4].v_nmembs; | 2484 | sci->sc_nfreesegs = argv[4].v_nmembs; |
@@ -2510,7 +2510,7 @@ int nilfs_clean_segments(struct super_block *sb, struct nilfs_argv *argv, | |||
2510 | out_unlock: | 2510 | out_unlock: |
2511 | sci->sc_freesegs = NULL; | 2511 | sci->sc_freesegs = NULL; |
2512 | sci->sc_nfreesegs = 0; | 2512 | sci->sc_nfreesegs = 0; |
2513 | nilfs_clear_gcdat_inode(nilfs); | 2513 | nilfs_mdt_clear_shadow_map(nilfs->ns_dat); |
2514 | nilfs_transaction_unlock(sbi); | 2514 | nilfs_transaction_unlock(sbi); |
2515 | return err; | 2515 | return err; |
2516 | } | 2516 | } |