btrfs: Don't pass fs_info to btrfs_run_delayed_items/_nr
We already pass the transaction which has a reference to the fs_info, so use that. No functional changes. Signed-off-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
committed by
David Sterba
parent
b84acab38f
commit
e5c304e651
@@ -1162,14 +1162,12 @@ static int __btrfs_run_delayed_items(struct btrfs_trans_handle *trans, int nr)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int btrfs_run_delayed_items(struct btrfs_trans_handle *trans,
|
int btrfs_run_delayed_items(struct btrfs_trans_handle *trans)
|
||||||
struct btrfs_fs_info *fs_info)
|
|
||||||
{
|
{
|
||||||
return __btrfs_run_delayed_items(trans, -1);
|
return __btrfs_run_delayed_items(trans, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int btrfs_run_delayed_items_nr(struct btrfs_trans_handle *trans,
|
int btrfs_run_delayed_items_nr(struct btrfs_trans_handle *trans, int nr)
|
||||||
struct btrfs_fs_info *fs_info, int nr)
|
|
||||||
{
|
{
|
||||||
return __btrfs_run_delayed_items(trans, nr);
|
return __btrfs_run_delayed_items(trans, nr);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,10 +111,8 @@ int btrfs_delete_delayed_dir_index(struct btrfs_trans_handle *trans,
|
|||||||
|
|
||||||
int btrfs_inode_delayed_dir_index_count(struct btrfs_inode *inode);
|
int btrfs_inode_delayed_dir_index_count(struct btrfs_inode *inode);
|
||||||
|
|
||||||
int btrfs_run_delayed_items(struct btrfs_trans_handle *trans,
|
int btrfs_run_delayed_items(struct btrfs_trans_handle *trans);
|
||||||
struct btrfs_fs_info *fs_info);
|
int btrfs_run_delayed_items_nr(struct btrfs_trans_handle *trans, int nr);
|
||||||
int btrfs_run_delayed_items_nr(struct btrfs_trans_handle *trans,
|
|
||||||
struct btrfs_fs_info *fs_info, int nr);
|
|
||||||
|
|
||||||
void btrfs_balance_delayed_items(struct btrfs_fs_info *fs_info);
|
void btrfs_balance_delayed_items(struct btrfs_fs_info *fs_info);
|
||||||
|
|
||||||
|
|||||||
@@ -4994,7 +4994,7 @@ static void flush_space(struct btrfs_fs_info *fs_info,
|
|||||||
ret = PTR_ERR(trans);
|
ret = PTR_ERR(trans);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ret = btrfs_run_delayed_items_nr(trans, fs_info, nr);
|
ret = btrfs_run_delayed_items_nr(trans, nr);
|
||||||
btrfs_end_transaction(trans);
|
btrfs_end_transaction(trans);
|
||||||
break;
|
break;
|
||||||
case FLUSH_DELALLOC:
|
case FLUSH_DELALLOC:
|
||||||
|
|||||||
@@ -1530,7 +1530,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
|
|||||||
* otherwise we corrupt the FS during
|
* otherwise we corrupt the FS during
|
||||||
* snapshot
|
* snapshot
|
||||||
*/
|
*/
|
||||||
ret = btrfs_run_delayed_items(trans, fs_info);
|
ret = btrfs_run_delayed_items(trans);
|
||||||
if (ret) { /* Transaction aborted */
|
if (ret) { /* Transaction aborted */
|
||||||
btrfs_abort_transaction(trans, ret);
|
btrfs_abort_transaction(trans, ret);
|
||||||
goto fail;
|
goto fail;
|
||||||
@@ -2067,7 +2067,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
|
|||||||
if (ret)
|
if (ret)
|
||||||
goto cleanup_transaction;
|
goto cleanup_transaction;
|
||||||
|
|
||||||
ret = btrfs_run_delayed_items(trans, fs_info);
|
ret = btrfs_run_delayed_items(trans);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto cleanup_transaction;
|
goto cleanup_transaction;
|
||||||
|
|
||||||
@@ -2075,7 +2075,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
|
|||||||
extwriter_counter_read(cur_trans) == 0);
|
extwriter_counter_read(cur_trans) == 0);
|
||||||
|
|
||||||
/* some pending stuffs might be added after the previous flush. */
|
/* some pending stuffs might be added after the previous flush. */
|
||||||
ret = btrfs_run_delayed_items(trans, fs_info);
|
ret = btrfs_run_delayed_items(trans);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto cleanup_transaction;
|
goto cleanup_transaction;
|
||||||
|
|
||||||
@@ -2128,7 +2128,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
|
|||||||
* because all the tree which are snapshoted will be forced to COW
|
* because all the tree which are snapshoted will be forced to COW
|
||||||
* the nodes and leaves.
|
* the nodes and leaves.
|
||||||
*/
|
*/
|
||||||
ret = btrfs_run_delayed_items(trans, fs_info);
|
ret = btrfs_run_delayed_items(trans);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
mutex_unlock(&fs_info->reloc_mutex);
|
mutex_unlock(&fs_info->reloc_mutex);
|
||||||
goto scrub_continue;
|
goto scrub_continue;
|
||||||
|
|||||||
@@ -853,7 +853,6 @@ static noinline int drop_one_dir_item(struct btrfs_trans_handle *trans,
|
|||||||
struct btrfs_inode *dir,
|
struct btrfs_inode *dir,
|
||||||
struct btrfs_dir_item *di)
|
struct btrfs_dir_item *di)
|
||||||
{
|
{
|
||||||
struct btrfs_fs_info *fs_info = root->fs_info;
|
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
char *name;
|
char *name;
|
||||||
int name_len;
|
int name_len;
|
||||||
@@ -887,7 +886,7 @@ static noinline int drop_one_dir_item(struct btrfs_trans_handle *trans,
|
|||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
else
|
else
|
||||||
ret = btrfs_run_delayed_items(trans, fs_info);
|
ret = btrfs_run_delayed_items(trans);
|
||||||
out:
|
out:
|
||||||
kfree(name);
|
kfree(name);
|
||||||
iput(inode);
|
iput(inode);
|
||||||
@@ -1007,7 +1006,6 @@ static inline int __add_inode_ref(struct btrfs_trans_handle *trans,
|
|||||||
u64 ref_index, char *name, int namelen,
|
u64 ref_index, char *name, int namelen,
|
||||||
int *search_done)
|
int *search_done)
|
||||||
{
|
{
|
||||||
struct btrfs_fs_info *fs_info = root->fs_info;
|
|
||||||
int ret;
|
int ret;
|
||||||
char *victim_name;
|
char *victim_name;
|
||||||
int victim_name_len;
|
int victim_name_len;
|
||||||
@@ -1065,7 +1063,7 @@ again:
|
|||||||
kfree(victim_name);
|
kfree(victim_name);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
ret = btrfs_run_delayed_items(trans, fs_info);
|
ret = btrfs_run_delayed_items(trans);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
*search_done = 1;
|
*search_done = 1;
|
||||||
@@ -1136,8 +1134,7 @@ again:
|
|||||||
victim_name_len);
|
victim_name_len);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
ret = btrfs_run_delayed_items(
|
ret = btrfs_run_delayed_items(
|
||||||
trans,
|
trans);
|
||||||
fs_info);
|
|
||||||
}
|
}
|
||||||
iput(victim_parent);
|
iput(victim_parent);
|
||||||
kfree(victim_name);
|
kfree(victim_name);
|
||||||
@@ -2098,7 +2095,6 @@ static noinline int check_item_in_log(struct btrfs_trans_handle *trans,
|
|||||||
struct inode *dir,
|
struct inode *dir,
|
||||||
struct btrfs_key *dir_key)
|
struct btrfs_key *dir_key)
|
||||||
{
|
{
|
||||||
struct btrfs_fs_info *fs_info = root->fs_info;
|
|
||||||
int ret;
|
int ret;
|
||||||
struct extent_buffer *eb;
|
struct extent_buffer *eb;
|
||||||
int slot;
|
int slot;
|
||||||
@@ -2162,7 +2158,7 @@ again:
|
|||||||
ret = btrfs_unlink_inode(trans, root, BTRFS_I(dir),
|
ret = btrfs_unlink_inode(trans, root, BTRFS_I(dir),
|
||||||
BTRFS_I(inode), name, name_len);
|
BTRFS_I(inode), name, name_len);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
ret = btrfs_run_delayed_items(trans, fs_info);
|
ret = btrfs_run_delayed_items(trans);
|
||||||
kfree(name);
|
kfree(name);
|
||||||
iput(inode);
|
iput(inode);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|||||||
Reference in New Issue
Block a user