diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2009-04-06 22:01:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-07 11:31:19 -0400 |
commit | 458c5b0822a669d170fdb7bb16c9145f652ebe06 (patch) | |
tree | f2c53998492306a8aaf6d20ded229b69cba17348 /fs/nilfs2/segment.c | |
parent | e62687468588f47c32256e3c8c36157c40111b6e (diff) |
nilfs2: clean up sketch file
The sketch file is a file to mark checkpoints with user data. It was
experimentally introduced in the original implementation, and now
obsolete. The file was handled differently with regular files; the file
size got truncated when a checkpoint was created.
This stops the special treatment and will treat it as a regular file.
Most users are not affected because mkfs.nilfs2 no longer makes this file.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/nilfs2/segment.c')
-rw-r--r-- | fs/nilfs2/segment.c | 49 |
1 files changed, 1 insertions, 48 deletions
diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index 9a87410985b9..981c34a0cd69 100644 --- a/fs/nilfs2/segment.c +++ b/fs/nilfs2/segment.c | |||
@@ -67,7 +67,6 @@ enum { | |||
67 | NILFS_ST_INIT = 0, | 67 | NILFS_ST_INIT = 0, |
68 | NILFS_ST_GC, /* Collecting dirty blocks for GC */ | 68 | NILFS_ST_GC, /* Collecting dirty blocks for GC */ |
69 | NILFS_ST_FILE, | 69 | NILFS_ST_FILE, |
70 | NILFS_ST_SKETCH, | ||
71 | NILFS_ST_IFILE, | 70 | NILFS_ST_IFILE, |
72 | NILFS_ST_CPFILE, | 71 | NILFS_ST_CPFILE, |
73 | NILFS_ST_SUFILE, | 72 | NILFS_ST_SUFILE, |
@@ -887,8 +886,7 @@ static int nilfs_segctor_fill_in_checkpoint(struct nilfs_sc_info *sci) | |||
887 | cpu_to_le64(sci->sc_nblk_inc + sci->sc_nblk_this_inc); | 886 | cpu_to_le64(sci->sc_nblk_inc + sci->sc_nblk_this_inc); |
888 | raw_cp->cp_create = cpu_to_le64(sci->sc_seg_ctime); | 887 | raw_cp->cp_create = cpu_to_le64(sci->sc_seg_ctime); |
889 | raw_cp->cp_cno = cpu_to_le64(nilfs->ns_cno); | 888 | raw_cp->cp_cno = cpu_to_le64(nilfs->ns_cno); |
890 | if (sci->sc_sketch_inode && i_size_read(sci->sc_sketch_inode) > 0) | 889 | |
891 | nilfs_checkpoint_set_sketch(raw_cp); | ||
892 | nilfs_write_inode_common(sbi->s_ifile, &raw_cp->cp_ifile_inode, 1); | 890 | nilfs_write_inode_common(sbi->s_ifile, &raw_cp->cp_ifile_inode, 1); |
893 | nilfs_cpfile_put_checkpoint(nilfs->ns_cpfile, nilfs->ns_cno, bh_cp); | 891 | nilfs_cpfile_put_checkpoint(nilfs->ns_cpfile, nilfs->ns_cno, bh_cp); |
894 | return 0; | 892 | return 0; |
@@ -923,11 +921,6 @@ static void nilfs_segctor_fill_in_file_bmap(struct nilfs_sc_info *sci, | |||
923 | nilfs_fill_in_file_bmap(ifile, ii); | 921 | nilfs_fill_in_file_bmap(ifile, ii); |
924 | set_bit(NILFS_I_COLLECTED, &ii->i_state); | 922 | set_bit(NILFS_I_COLLECTED, &ii->i_state); |
925 | } | 923 | } |
926 | if (sci->sc_sketch_inode) { | ||
927 | ii = NILFS_I(sci->sc_sketch_inode); | ||
928 | if (test_bit(NILFS_I_DIRTY, &ii->i_state)) | ||
929 | nilfs_fill_in_file_bmap(ifile, ii); | ||
930 | } | ||
931 | } | 924 | } |
932 | 925 | ||
933 | /* | 926 | /* |
@@ -1228,26 +1221,6 @@ static int nilfs_segctor_collect_blocks(struct nilfs_sc_info *sci, int mode) | |||
1228 | sci->sc_stage.scnt = NILFS_ST_DONE; | 1221 | sci->sc_stage.scnt = NILFS_ST_DONE; |
1229 | return 0; | 1222 | return 0; |
1230 | } | 1223 | } |
1231 | sci->sc_stage.scnt++; /* Fall through */ | ||
1232 | case NILFS_ST_SKETCH: | ||
1233 | if (mode == SC_LSEG_SR && sci->sc_sketch_inode) { | ||
1234 | ii = NILFS_I(sci->sc_sketch_inode); | ||
1235 | if (test_bit(NILFS_I_DIRTY, &ii->i_state)) { | ||
1236 | sci->sc_sketch_inode->i_ctime.tv_sec | ||
1237 | = sci->sc_seg_ctime; | ||
1238 | sci->sc_sketch_inode->i_mtime.tv_sec | ||
1239 | = sci->sc_seg_ctime; | ||
1240 | err = nilfs_mark_inode_dirty( | ||
1241 | sci->sc_sketch_inode); | ||
1242 | if (unlikely(err)) | ||
1243 | goto break_or_fail; | ||
1244 | } | ||
1245 | err = nilfs_segctor_scan_file(sci, | ||
1246 | sci->sc_sketch_inode, | ||
1247 | &nilfs_sc_file_ops); | ||
1248 | if (unlikely(err)) | ||
1249 | goto break_or_fail; | ||
1250 | } | ||
1251 | sci->sc_stage.scnt++; | 1224 | sci->sc_stage.scnt++; |
1252 | sci->sc_stage.flags |= NILFS_CF_IFILE_STARTED; | 1225 | sci->sc_stage.flags |= NILFS_CF_IFILE_STARTED; |
1253 | /* Fall through */ | 1226 | /* Fall through */ |
@@ -2385,13 +2358,6 @@ static int nilfs_segctor_do_construct(struct nilfs_sc_info *sci, int mode) | |||
2385 | 2358 | ||
2386 | } while (sci->sc_stage.scnt != NILFS_ST_DONE); | 2359 | } while (sci->sc_stage.scnt != NILFS_ST_DONE); |
2387 | 2360 | ||
2388 | /* Clearing sketch data */ | ||
2389 | if (has_sr && sci->sc_sketch_inode) { | ||
2390 | if (i_size_read(sci->sc_sketch_inode) == 0) | ||
2391 | clear_bit(NILFS_I_DIRTY, | ||
2392 | &NILFS_I(sci->sc_sketch_inode)->i_state); | ||
2393 | i_size_write(sci->sc_sketch_inode, 0); | ||
2394 | } | ||
2395 | out: | 2361 | out: |
2396 | nilfs_segctor_destroy_segment_buffers(sci); | 2362 | nilfs_segctor_destroy_segment_buffers(sci); |
2397 | nilfs_segctor_check_out_files(sci, sbi); | 2363 | nilfs_segctor_check_out_files(sci, sbi); |
@@ -2971,11 +2937,6 @@ static int nilfs_segctor_init(struct nilfs_sc_info *sci, | |||
2971 | struct nilfs_recovery_info *ri) | 2937 | struct nilfs_recovery_info *ri) |
2972 | { | 2938 | { |
2973 | int err; | 2939 | int err; |
2974 | struct inode *inode = nilfs_iget(sci->sc_super, NILFS_SKETCH_INO); | ||
2975 | |||
2976 | sci->sc_sketch_inode = IS_ERR(inode) ? NULL : inode; | ||
2977 | if (sci->sc_sketch_inode) | ||
2978 | i_size_write(sci->sc_sketch_inode, 0); | ||
2979 | 2940 | ||
2980 | sci->sc_seq_done = sci->sc_seq_request; | 2941 | sci->sc_seq_done = sci->sc_seq_request; |
2981 | if (ri) | 2942 | if (ri) |
@@ -2987,10 +2948,6 @@ static int nilfs_segctor_init(struct nilfs_sc_info *sci, | |||
2987 | if (ri) | 2948 | if (ri) |
2988 | list_splice_init(&sci->sc_active_segments, | 2949 | list_splice_init(&sci->sc_active_segments, |
2989 | ri->ri_used_segments.prev); | 2950 | ri->ri_used_segments.prev); |
2990 | if (sci->sc_sketch_inode) { | ||
2991 | iput(sci->sc_sketch_inode); | ||
2992 | sci->sc_sketch_inode = NULL; | ||
2993 | } | ||
2994 | } | 2951 | } |
2995 | return err; | 2952 | return err; |
2996 | } | 2953 | } |
@@ -3090,10 +3047,6 @@ static void nilfs_segctor_destroy(struct nilfs_sc_info *sci) | |||
3090 | 3047 | ||
3091 | WARN_ON(!list_empty(&sci->sc_segbufs)); | 3048 | WARN_ON(!list_empty(&sci->sc_segbufs)); |
3092 | 3049 | ||
3093 | if (sci->sc_sketch_inode) { | ||
3094 | iput(sci->sc_sketch_inode); | ||
3095 | sci->sc_sketch_inode = NULL; | ||
3096 | } | ||
3097 | down_write(&sbi->s_nilfs->ns_segctor_sem); | 3050 | down_write(&sbi->s_nilfs->ns_segctor_sem); |
3098 | 3051 | ||
3099 | kfree(sci); | 3052 | kfree(sci); |