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/inode.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/inode.c')
-rw-r--r-- | fs/nilfs2/inode.c | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c index b6536bb2a324..a1922b17662c 100644 --- a/fs/nilfs2/inode.c +++ b/fs/nilfs2/inode.c | |||
@@ -418,30 +418,6 @@ int nilfs_read_inode_common(struct inode *inode, | |||
418 | return 0; | 418 | return 0; |
419 | } | 419 | } |
420 | 420 | ||
421 | static int nilfs_read_sketch_inode(struct inode *inode) | ||
422 | { | ||
423 | struct nilfs_sb_info *sbi = NILFS_SB(inode->i_sb); | ||
424 | int err = 0; | ||
425 | |||
426 | if (sbi->s_snapshot_cno) { | ||
427 | struct the_nilfs *nilfs = sbi->s_nilfs; | ||
428 | struct buffer_head *bh_cp; | ||
429 | struct nilfs_checkpoint *raw_cp; | ||
430 | |||
431 | err = nilfs_cpfile_get_checkpoint( | ||
432 | nilfs->ns_cpfile, sbi->s_snapshot_cno, 0, &raw_cp, | ||
433 | &bh_cp); | ||
434 | if (likely(!err)) { | ||
435 | if (!nilfs_checkpoint_sketch(raw_cp)) | ||
436 | inode->i_size = 0; | ||
437 | nilfs_cpfile_put_checkpoint( | ||
438 | nilfs->ns_cpfile, sbi->s_snapshot_cno, bh_cp); | ||
439 | } | ||
440 | inode->i_flags |= S_NOCMTIME; | ||
441 | } | ||
442 | return err; | ||
443 | } | ||
444 | |||
445 | static int __nilfs_read_inode(struct super_block *sb, unsigned long ino, | 421 | static int __nilfs_read_inode(struct super_block *sb, unsigned long ino, |
446 | struct inode *inode) | 422 | struct inode *inode) |
447 | { | 423 | { |
@@ -469,11 +445,6 @@ static int __nilfs_read_inode(struct super_block *sb, unsigned long ino, | |||
469 | inode->i_op = &nilfs_file_inode_operations; | 445 | inode->i_op = &nilfs_file_inode_operations; |
470 | inode->i_fop = &nilfs_file_operations; | 446 | inode->i_fop = &nilfs_file_operations; |
471 | inode->i_mapping->a_ops = &nilfs_aops; | 447 | inode->i_mapping->a_ops = &nilfs_aops; |
472 | if (unlikely(inode->i_ino == NILFS_SKETCH_INO)) { | ||
473 | err = nilfs_read_sketch_inode(inode); | ||
474 | if (unlikely(err)) | ||
475 | goto failed_unmap; | ||
476 | } | ||
477 | } else if (S_ISDIR(inode->i_mode)) { | 448 | } else if (S_ISDIR(inode->i_mode)) { |
478 | inode->i_op = &nilfs_dir_inode_operations; | 449 | inode->i_op = &nilfs_dir_inode_operations; |
479 | inode->i_fop = &nilfs_dir_operations; | 450 | inode->i_fop = &nilfs_dir_operations; |
@@ -742,8 +713,7 @@ int nilfs_set_file_dirty(struct nilfs_sb_info *sbi, struct inode *inode, | |||
742 | 713 | ||
743 | atomic_add(nr_dirty, &sbi->s_nilfs->ns_ndirtyblks); | 714 | atomic_add(nr_dirty, &sbi->s_nilfs->ns_ndirtyblks); |
744 | 715 | ||
745 | if (test_and_set_bit(NILFS_I_DIRTY, &ii->i_state) || | 716 | if (test_and_set_bit(NILFS_I_DIRTY, &ii->i_state)) |
746 | unlikely(inode->i_ino == NILFS_SKETCH_INO)) | ||
747 | return 0; | 717 | return 0; |
748 | 718 | ||
749 | spin_lock(&sbi->s_inode_lock); | 719 | spin_lock(&sbi->s_inode_lock); |
@@ -811,7 +781,6 @@ void nilfs_dirty_inode(struct inode *inode) | |||
811 | return; | 781 | return; |
812 | } | 782 | } |
813 | nilfs_transaction_begin(inode->i_sb, &ti, 0); | 783 | nilfs_transaction_begin(inode->i_sb, &ti, 0); |
814 | if (likely(inode->i_ino != NILFS_SKETCH_INO)) | 784 | nilfs_mark_inode_dirty(inode); |
815 | nilfs_mark_inode_dirty(inode); | ||
816 | nilfs_transaction_commit(inode->i_sb); /* never fails */ | 785 | nilfs_transaction_commit(inode->i_sb); /* never fails */ |
817 | } | 786 | } |