Commit f882274b authored by Nikolay Borisov's avatar Nikolay Borisov Committed by David Sterba

btrfs: Remove root arg from btrfs_log_inode_parent

btrfs_log_inode_parent is called from 2 places (btrfs_log_dentry_safe
and btrfs_log_new_name) both of which pass inode->root as the root
argument and the inode itself. Remove the redundant root argument and
get a reference to the root directly from the inode, also remove
redundant root != inode->root check from the same function. No
functional change.
Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 448f3a17
...@@ -5513,7 +5513,6 @@ static int btrfs_log_all_parents(struct btrfs_trans_handle *trans, ...@@ -5513,7 +5513,6 @@ static int btrfs_log_all_parents(struct btrfs_trans_handle *trans,
* the last committed transaction * the last committed transaction
*/ */
static int btrfs_log_inode_parent(struct btrfs_trans_handle *trans, static int btrfs_log_inode_parent(struct btrfs_trans_handle *trans,
struct btrfs_root *root,
struct btrfs_inode *inode, struct btrfs_inode *inode,
struct dentry *parent, struct dentry *parent,
const loff_t start, const loff_t start,
...@@ -5521,6 +5520,7 @@ static int btrfs_log_inode_parent(struct btrfs_trans_handle *trans, ...@@ -5521,6 +5520,7 @@ static int btrfs_log_inode_parent(struct btrfs_trans_handle *trans,
int inode_only, int inode_only,
struct btrfs_log_ctx *ctx) struct btrfs_log_ctx *ctx)
{ {
struct btrfs_root *root = inode->root;
struct btrfs_fs_info *fs_info = root->fs_info; struct btrfs_fs_info *fs_info = root->fs_info;
struct super_block *sb; struct super_block *sb;
struct dentry *old_parent = NULL; struct dentry *old_parent = NULL;
...@@ -5546,7 +5546,7 @@ static int btrfs_log_inode_parent(struct btrfs_trans_handle *trans, ...@@ -5546,7 +5546,7 @@ static int btrfs_log_inode_parent(struct btrfs_trans_handle *trans,
goto end_no_trans; goto end_no_trans;
} }
if (root != inode->root || btrfs_root_refs(&root->root_item) == 0) { if (btrfs_root_refs(&root->root_item) == 0) {
ret = 1; ret = 1;
goto end_no_trans; goto end_no_trans;
} }
...@@ -5686,8 +5686,8 @@ int btrfs_log_dentry_safe(struct btrfs_trans_handle *trans, ...@@ -5686,8 +5686,8 @@ int btrfs_log_dentry_safe(struct btrfs_trans_handle *trans,
struct dentry *parent = dget_parent(dentry); struct dentry *parent = dget_parent(dentry);
int ret; int ret;
ret = btrfs_log_inode_parent(trans, root, BTRFS_I(d_inode(dentry)), ret = btrfs_log_inode_parent(trans, BTRFS_I(d_inode(dentry)), parent,
parent, start, end, LOG_INODE_ALL, ctx); start, end, LOG_INODE_ALL, ctx);
dput(parent); dput(parent);
return ret; return ret;
...@@ -5949,7 +5949,6 @@ int btrfs_log_new_name(struct btrfs_trans_handle *trans, ...@@ -5949,7 +5949,6 @@ int btrfs_log_new_name(struct btrfs_trans_handle *trans,
struct dentry *parent) struct dentry *parent)
{ {
struct btrfs_fs_info *fs_info = btrfs_sb(inode->vfs_inode.i_sb); struct btrfs_fs_info *fs_info = btrfs_sb(inode->vfs_inode.i_sb);
struct btrfs_root *root = inode->root;
/* /*
* this will force the logging code to walk the dentry chain * this will force the logging code to walk the dentry chain
...@@ -5966,7 +5965,7 @@ int btrfs_log_new_name(struct btrfs_trans_handle *trans, ...@@ -5966,7 +5965,7 @@ int btrfs_log_new_name(struct btrfs_trans_handle *trans,
(!old_dir || old_dir->logged_trans <= fs_info->last_trans_committed)) (!old_dir || old_dir->logged_trans <= fs_info->last_trans_committed))
return 0; return 0;
return btrfs_log_inode_parent(trans, root, inode, parent, 0, return btrfs_log_inode_parent(trans, inode, parent, 0, LLONG_MAX,
LLONG_MAX, LOG_INODE_EXISTS, NULL); LOG_INODE_EXISTS, NULL);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment