summaryrefslogtreecommitdiff
path: root/fs/nilfs2/inode.c
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2009-04-07 06:01:56 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-07 19:31:19 +0400
commit458c5b0822a669d170fdb7bb16c9145f652ebe06 (patch)
treef2c53998492306a8aaf6d20ded229b69cba17348 /fs/nilfs2/inode.c
parente62687468588f47c32256e3c8c36157c40111b6e (diff)
downloadlinux-458c5b0822a669d170fdb7bb16c9145f652ebe06.tar.xz
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.c35
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,
return 0;
}
-static int nilfs_read_sketch_inode(struct inode *inode)
-{
- struct nilfs_sb_info *sbi = NILFS_SB(inode->i_sb);
- int err = 0;
-
- if (sbi->s_snapshot_cno) {
- struct the_nilfs *nilfs = sbi->s_nilfs;
- struct buffer_head *bh_cp;
- struct nilfs_checkpoint *raw_cp;
-
- err = nilfs_cpfile_get_checkpoint(
- nilfs->ns_cpfile, sbi->s_snapshot_cno, 0, &raw_cp,
- &bh_cp);
- if (likely(!err)) {
- if (!nilfs_checkpoint_sketch(raw_cp))
- inode->i_size = 0;
- nilfs_cpfile_put_checkpoint(
- nilfs->ns_cpfile, sbi->s_snapshot_cno, bh_cp);
- }
- inode->i_flags |= S_NOCMTIME;
- }
- return err;
-}
-
static int __nilfs_read_inode(struct super_block *sb, unsigned long ino,
struct inode *inode)
{
@@ -469,11 +445,6 @@ static int __nilfs_read_inode(struct super_block *sb, unsigned long ino,
inode->i_op = &nilfs_file_inode_operations;
inode->i_fop = &nilfs_file_operations;
inode->i_mapping->a_ops = &nilfs_aops;
- if (unlikely(inode->i_ino == NILFS_SKETCH_INO)) {
- err = nilfs_read_sketch_inode(inode);
- if (unlikely(err))
- goto failed_unmap;
- }
} else if (S_ISDIR(inode->i_mode)) {
inode->i_op = &nilfs_dir_inode_operations;
inode->i_fop = &nilfs_dir_operations;
@@ -742,8 +713,7 @@ int nilfs_set_file_dirty(struct nilfs_sb_info *sbi, struct inode *inode,
atomic_add(nr_dirty, &sbi->s_nilfs->ns_ndirtyblks);
- if (test_and_set_bit(NILFS_I_DIRTY, &ii->i_state) ||
- unlikely(inode->i_ino == NILFS_SKETCH_INO))
+ if (test_and_set_bit(NILFS_I_DIRTY, &ii->i_state))
return 0;
spin_lock(&sbi->s_inode_lock);
@@ -811,7 +781,6 @@ void nilfs_dirty_inode(struct inode *inode)
return;
}
nilfs_transaction_begin(inode->i_sb, &ti, 0);
- if (likely(inode->i_ino != NILFS_SKETCH_INO))
- nilfs_mark_inode_dirty(inode);
+ nilfs_mark_inode_dirty(inode);
nilfs_transaction_commit(inode->i_sb); /* never fails */
}