nilfs2: delete mark_inode_dirty from nilfs_set_link
authorJiro SEKIBA <jir@unicus.jp>
Fri, 27 Nov 2009 10:41:07 +0000 (19:41 +0900)
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Fri, 27 Nov 2009 11:05:15 +0000 (20:05 +0900)
Delete mark_inode_dirty() from nilfs_set_link() to reduce redundant
mark_inode_dirty() calls in caller of nilfs_set_link().

Signed-off-by: Jiro SEKIBA <jir@unicus.jp>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
fs/nilfs2/dir.c
fs/nilfs2/namei.c

index e097099bfc8f0923480e110243979d9ace0be924..4f3fa0030e2c81d731f3600c552d0121bbdb61d9 100644 (file)
@@ -459,7 +459,6 @@ void nilfs_set_link(struct inode *dir, struct nilfs_dir_entry *de,
        nilfs_put_page(page);
        dir->i_mtime = dir->i_ctime = CURRENT_TIME;
 /*     NILFS_I(dir)->i_flags &= ~NILFS_BTREE_FL; */
-       mark_inode_dirty(dir);
 }
 
 /*
index 01adda8232978be60f59eed92b9e6af8f09054ae..4616f96be7007a49d4f03404eae980c95b283711 100644 (file)
@@ -397,6 +397,7 @@ static int nilfs_rename(struct inode *old_dir, struct dentry *old_dentry,
                        goto out_dir;
                inode_inc_link_count(old_inode);
                nilfs_set_link(new_dir, new_de, new_page, old_inode);
+               mark_inode_dirty(new_dir);
                new_inode->i_ctime = CURRENT_TIME;
                if (dir_de)
                        drop_nlink(new_inode);
@@ -425,12 +426,13 @@ static int nilfs_rename(struct inode *old_dir, struct dentry *old_dentry,
        old_inode->i_ctime = CURRENT_TIME;
 
        nilfs_delete_entry(old_de, old_page);
-       inode_dec_link_count(old_inode);
+       drop_nlink(old_inode);
 
        if (dir_de) {
                nilfs_set_link(old_inode, dir_de, dir_page, new_dir);
                inode_dec_link_count(old_dir);
        }
+       mark_inode_dirty(old_inode);
 
        err = nilfs_transaction_commit(old_dir->i_sb);
        return err;