提交 abdb318b 编写于 作者: J Jiro SEKIBA 提交者: Ryusuke Konishi

nilfs2: replace mark_inode_dirty as nilfs_mark_inode_dirty

Replace mark_inode_dirty() as nilfs_mark_inode_dirty()
to reduce deep function calls.
Signed-off-by: NJiro SEKIBA <jir@unicus.jp>
Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
上级 3534573b
...@@ -548,7 +548,7 @@ int nilfs_add_link(struct dentry *dentry, struct inode *inode) ...@@ -548,7 +548,7 @@ int nilfs_add_link(struct dentry *dentry, struct inode *inode)
nilfs_commit_chunk(page, page->mapping, from, to); nilfs_commit_chunk(page, page->mapping, from, to);
dir->i_mtime = dir->i_ctime = CURRENT_TIME; dir->i_mtime = dir->i_ctime = CURRENT_TIME;
/* NILFS_I(dir)->i_flags &= ~NILFS_BTREE_FL; */ /* NILFS_I(dir)->i_flags &= ~NILFS_BTREE_FL; */
mark_inode_dirty(dir); nilfs_mark_inode_dirty(dir);
/* OFFSET_CACHE */ /* OFFSET_CACHE */
out_put: out_put:
nilfs_put_page(page); nilfs_put_page(page);
......
...@@ -97,7 +97,7 @@ int nilfs_get_block(struct inode *inode, sector_t blkoff, ...@@ -97,7 +97,7 @@ int nilfs_get_block(struct inode *inode, sector_t blkoff,
nilfs_transaction_abort(inode->i_sb); nilfs_transaction_abort(inode->i_sb);
goto out; goto out;
} }
mark_inode_dirty(inode); nilfs_mark_inode_dirty(inode);
nilfs_transaction_commit(inode->i_sb); /* never fails */ nilfs_transaction_commit(inode->i_sb); /* never fails */
/* Error handling should be detailed */ /* Error handling should be detailed */
set_buffer_new(bh_result); set_buffer_new(bh_result);
...@@ -598,7 +598,7 @@ void nilfs_truncate(struct inode *inode) ...@@ -598,7 +598,7 @@ void nilfs_truncate(struct inode *inode)
if (IS_SYNC(inode)) if (IS_SYNC(inode))
nilfs_set_transaction_flag(NILFS_TI_SYNC); nilfs_set_transaction_flag(NILFS_TI_SYNC);
mark_inode_dirty(inode); nilfs_mark_inode_dirty(inode);
nilfs_set_file_dirty(NILFS_SB(sb), inode, 0); nilfs_set_file_dirty(NILFS_SB(sb), inode, 0);
nilfs_transaction_commit(sb); nilfs_transaction_commit(sb);
/* May construct a logical segment and may fail in sync mode. /* May construct a logical segment and may fail in sync mode.
...@@ -623,7 +623,7 @@ void nilfs_delete_inode(struct inode *inode) ...@@ -623,7 +623,7 @@ void nilfs_delete_inode(struct inode *inode)
truncate_inode_pages(&inode->i_data, 0); truncate_inode_pages(&inode->i_data, 0);
nilfs_truncate_bmap(ii, 0); nilfs_truncate_bmap(ii, 0);
mark_inode_dirty(inode); nilfs_mark_inode_dirty(inode);
nilfs_free_inode(inode); nilfs_free_inode(inode);
/* nilfs_free_inode() marks inode buffer dirty */ /* nilfs_free_inode() marks inode buffer dirty */
if (IS_SYNC(inode)) if (IS_SYNC(inode))
......
...@@ -120,7 +120,7 @@ static int nilfs_create(struct inode *dir, struct dentry *dentry, int mode, ...@@ -120,7 +120,7 @@ static int nilfs_create(struct inode *dir, struct dentry *dentry, int mode,
inode->i_op = &nilfs_file_inode_operations; inode->i_op = &nilfs_file_inode_operations;
inode->i_fop = &nilfs_file_operations; inode->i_fop = &nilfs_file_operations;
inode->i_mapping->a_ops = &nilfs_aops; inode->i_mapping->a_ops = &nilfs_aops;
mark_inode_dirty(inode); nilfs_mark_inode_dirty(inode);
err = nilfs_add_nondir(dentry, inode); err = nilfs_add_nondir(dentry, inode);
} }
if (!err) if (!err)
...@@ -148,7 +148,7 @@ nilfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev) ...@@ -148,7 +148,7 @@ nilfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev)
err = PTR_ERR(inode); err = PTR_ERR(inode);
if (!IS_ERR(inode)) { if (!IS_ERR(inode)) {
init_special_inode(inode, inode->i_mode, rdev); init_special_inode(inode, inode->i_mode, rdev);
mark_inode_dirty(inode); nilfs_mark_inode_dirty(inode);
err = nilfs_add_nondir(dentry, inode); err = nilfs_add_nondir(dentry, inode);
} }
if (!err) if (!err)
...@@ -201,7 +201,7 @@ static int nilfs_symlink(struct inode *dir, struct dentry *dentry, ...@@ -201,7 +201,7 @@ static int nilfs_symlink(struct inode *dir, struct dentry *dentry,
out_fail: out_fail:
drop_nlink(inode); drop_nlink(inode);
mark_inode_dirty(inode); nilfs_mark_inode_dirty(inode);
iput(inode); iput(inode);
goto out; goto out;
} }
...@@ -267,7 +267,7 @@ static int nilfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) ...@@ -267,7 +267,7 @@ static int nilfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
if (err) if (err)
goto out_fail; goto out_fail;
mark_inode_dirty(inode); nilfs_mark_inode_dirty(inode);
d_instantiate(dentry, inode); d_instantiate(dentry, inode);
out: out:
if (!err) if (!err)
...@@ -280,11 +280,11 @@ static int nilfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) ...@@ -280,11 +280,11 @@ static int nilfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
out_fail: out_fail:
drop_nlink(inode); drop_nlink(inode);
drop_nlink(inode); drop_nlink(inode);
mark_inode_dirty(inode); nilfs_mark_inode_dirty(inode);
iput(inode); iput(inode);
out_dir: out_dir:
drop_nlink(dir); drop_nlink(dir);
mark_inode_dirty(dir); nilfs_mark_inode_dirty(dir);
goto out; goto out;
} }
...@@ -334,8 +334,8 @@ static int nilfs_unlink(struct inode *dir, struct dentry *dentry) ...@@ -334,8 +334,8 @@ static int nilfs_unlink(struct inode *dir, struct dentry *dentry)
err = nilfs_do_unlink(dir, dentry); err = nilfs_do_unlink(dir, dentry);
if (!err) { if (!err) {
mark_inode_dirty(dir); nilfs_mark_inode_dirty(dir);
mark_inode_dirty(dentry->d_inode); nilfs_mark_inode_dirty(dentry->d_inode);
err = nilfs_transaction_commit(dir->i_sb); err = nilfs_transaction_commit(dir->i_sb);
} else } else
nilfs_transaction_abort(dir->i_sb); nilfs_transaction_abort(dir->i_sb);
...@@ -359,9 +359,9 @@ static int nilfs_rmdir(struct inode *dir, struct dentry *dentry) ...@@ -359,9 +359,9 @@ static int nilfs_rmdir(struct inode *dir, struct dentry *dentry)
if (!err) { if (!err) {
inode->i_size = 0; inode->i_size = 0;
drop_nlink(inode); drop_nlink(inode);
mark_inode_dirty(inode); nilfs_mark_inode_dirty(inode);
drop_nlink(dir); drop_nlink(dir);
mark_inode_dirty(dir); nilfs_mark_inode_dirty(dir);
} }
} }
if (!err) if (!err)
...@@ -414,12 +414,12 @@ static int nilfs_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -414,12 +414,12 @@ static int nilfs_rename(struct inode *old_dir, struct dentry *old_dentry,
goto out_dir; goto out_dir;
inc_nlink(old_inode); inc_nlink(old_inode);
nilfs_set_link(new_dir, new_de, new_page, old_inode); nilfs_set_link(new_dir, new_de, new_page, old_inode);
mark_inode_dirty(new_dir); nilfs_mark_inode_dirty(new_dir);
new_inode->i_ctime = CURRENT_TIME; new_inode->i_ctime = CURRENT_TIME;
if (dir_de) if (dir_de)
drop_nlink(new_inode); drop_nlink(new_inode);
drop_nlink(new_inode); drop_nlink(new_inode);
mark_inode_dirty(new_inode); nilfs_mark_inode_dirty(new_inode);
} else { } else {
if (dir_de) { if (dir_de) {
err = -EMLINK; err = -EMLINK;
...@@ -430,12 +430,12 @@ static int nilfs_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -430,12 +430,12 @@ static int nilfs_rename(struct inode *old_dir, struct dentry *old_dentry,
err = nilfs_add_link(new_dentry, old_inode); err = nilfs_add_link(new_dentry, old_inode);
if (err) { if (err) {
drop_nlink(old_inode); drop_nlink(old_inode);
mark_inode_dirty(old_inode); nilfs_mark_inode_dirty(old_inode);
goto out_dir; goto out_dir;
} }
if (dir_de) { if (dir_de) {
inc_nlink(new_dir); inc_nlink(new_dir);
mark_inode_dirty(new_dir); nilfs_mark_inode_dirty(new_dir);
} }
} }
...@@ -452,8 +452,8 @@ static int nilfs_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -452,8 +452,8 @@ static int nilfs_rename(struct inode *old_dir, struct dentry *old_dentry,
nilfs_set_link(old_inode, dir_de, dir_page, new_dir); nilfs_set_link(old_inode, dir_de, dir_page, new_dir);
drop_nlink(old_dir); drop_nlink(old_dir);
} }
mark_inode_dirty(old_dir); nilfs_mark_inode_dirty(old_dir);
mark_inode_dirty(old_inode); nilfs_mark_inode_dirty(old_inode);
err = nilfs_transaction_commit(old_dir->i_sb); err = nilfs_transaction_commit(old_dir->i_sb);
return err; return err;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册