summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolay Borisov <nborisov@suse.com>2018-02-07 10:55:43 -0500
committerDavid Sterba <dsterba@suse.com>2018-03-26 09:09:31 -0400
commite5c304e651e6ab13495d4aabb5e7d5d37933dc04 (patch)
tree064a8f99766df4d1d3f1f65926ce9b111f475509
parentb84acab38f58b775f8cd3f38422c610a75b3eb70 (diff)
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>
-rw-r--r--fs/btrfs/delayed-inode.c6
-rw-r--r--fs/btrfs/delayed-inode.h6
-rw-r--r--fs/btrfs/extent-tree.c2
-rw-r--r--fs/btrfs/transaction.c8
-rw-r--r--fs/btrfs/tree-log.c12
5 files changed, 13 insertions, 21 deletions
diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c
index 1acc03680e9c..09939fc37f2a 100644
--- a/fs/btrfs/delayed-inode.c
+++ b/fs/btrfs/delayed-inode.c
@@ -1162,14 +1162,12 @@ static int __btrfs_run_delayed_items(struct btrfs_trans_handle *trans, int nr)
1162 return ret; 1162 return ret;
1163} 1163}
1164 1164
1165int btrfs_run_delayed_items(struct btrfs_trans_handle *trans, 1165int btrfs_run_delayed_items(struct btrfs_trans_handle *trans)
1166 struct btrfs_fs_info *fs_info)
1167{ 1166{
1168 return __btrfs_run_delayed_items(trans, -1); 1167 return __btrfs_run_delayed_items(trans, -1);
1169} 1168}
1170 1169
1171int btrfs_run_delayed_items_nr(struct btrfs_trans_handle *trans, 1170int btrfs_run_delayed_items_nr(struct btrfs_trans_handle *trans, int nr)
1172 struct btrfs_fs_info *fs_info, int nr)
1173{ 1171{
1174 return __btrfs_run_delayed_items(trans, nr); 1172 return __btrfs_run_delayed_items(trans, nr);
1175} 1173}
diff --git a/fs/btrfs/delayed-inode.h b/fs/btrfs/delayed-inode.h
index c4189d495934..ae893d85224f 100644
--- a/fs/btrfs/delayed-inode.h
+++ b/fs/btrfs/delayed-inode.h
@@ -111,10 +111,8 @@ int btrfs_delete_delayed_dir_index(struct btrfs_trans_handle *trans,
111 111
112int btrfs_inode_delayed_dir_index_count(struct btrfs_inode *inode); 112int btrfs_inode_delayed_dir_index_count(struct btrfs_inode *inode);
113 113
114int btrfs_run_delayed_items(struct btrfs_trans_handle *trans, 114int btrfs_run_delayed_items(struct btrfs_trans_handle *trans);
115 struct btrfs_fs_info *fs_info); 115int btrfs_run_delayed_items_nr(struct btrfs_trans_handle *trans, int nr);
116int btrfs_run_delayed_items_nr(struct btrfs_trans_handle *trans,
117 struct btrfs_fs_info *fs_info, int nr);
118 116
119void btrfs_balance_delayed_items(struct btrfs_fs_info *fs_info); 117void btrfs_balance_delayed_items(struct btrfs_fs_info *fs_info);
120 118
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 194b813045a7..7b4d6789cc66 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -4994,7 +4994,7 @@ static void flush_space(struct btrfs_fs_info *fs_info,
4994 ret = PTR_ERR(trans); 4994 ret = PTR_ERR(trans);
4995 break; 4995 break;
4996 } 4996 }
4997 ret = btrfs_run_delayed_items_nr(trans, fs_info, nr); 4997 ret = btrfs_run_delayed_items_nr(trans, nr);
4998 btrfs_end_transaction(trans); 4998 btrfs_end_transaction(trans);
4999 break; 4999 break;
5000 case FLUSH_DELALLOC: 5000 case FLUSH_DELALLOC:
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 87f94228abe9..e332026a7f82 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -1530,7 +1530,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
1530 * otherwise we corrupt the FS during 1530 * otherwise we corrupt the FS during
1531 * snapshot 1531 * snapshot
1532 */ 1532 */
1533 ret = btrfs_run_delayed_items(trans, fs_info); 1533 ret = btrfs_run_delayed_items(trans);
1534 if (ret) { /* Transaction aborted */ 1534 if (ret) { /* Transaction aborted */
1535 btrfs_abort_transaction(trans, ret); 1535 btrfs_abort_transaction(trans, ret);
1536 goto fail; 1536 goto fail;
@@ -2067,7 +2067,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
2067 if (ret) 2067 if (ret)
2068 goto cleanup_transaction; 2068 goto cleanup_transaction;
2069 2069
2070 ret = btrfs_run_delayed_items(trans, fs_info); 2070 ret = btrfs_run_delayed_items(trans);
2071 if (ret) 2071 if (ret)
2072 goto cleanup_transaction; 2072 goto cleanup_transaction;
2073 2073
@@ -2075,7 +2075,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
2075 extwriter_counter_read(cur_trans) == 0); 2075 extwriter_counter_read(cur_trans) == 0);
2076 2076
2077 /* some pending stuffs might be added after the previous flush. */ 2077 /* some pending stuffs might be added after the previous flush. */
2078 ret = btrfs_run_delayed_items(trans, fs_info); 2078 ret = btrfs_run_delayed_items(trans);
2079 if (ret) 2079 if (ret)
2080 goto cleanup_transaction; 2080 goto cleanup_transaction;
2081 2081
@@ -2128,7 +2128,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
2128 * because all the tree which are snapshoted will be forced to COW 2128 * because all the tree which are snapshoted will be forced to COW
2129 * the nodes and leaves. 2129 * the nodes and leaves.
2130 */ 2130 */
2131 ret = btrfs_run_delayed_items(trans, fs_info); 2131 ret = btrfs_run_delayed_items(trans);
2132 if (ret) { 2132 if (ret) {
2133 mutex_unlock(&fs_info->reloc_mutex); 2133 mutex_unlock(&fs_info->reloc_mutex);
2134 goto scrub_continue; 2134 goto scrub_continue;
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 434457794c27..fac5fd1cc786 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -853,7 +853,6 @@ static noinline int drop_one_dir_item(struct btrfs_trans_handle *trans,
853 struct btrfs_inode *dir, 853 struct btrfs_inode *dir,
854 struct btrfs_dir_item *di) 854 struct btrfs_dir_item *di)
855{ 855{
856 struct btrfs_fs_info *fs_info = root->fs_info;
857 struct inode *inode; 856 struct inode *inode;
858 char *name; 857 char *name;
859 int name_len; 858 int name_len;
@@ -887,7 +886,7 @@ static noinline int drop_one_dir_item(struct btrfs_trans_handle *trans,
887 if (ret) 886 if (ret)
888 goto out; 887 goto out;
889 else 888 else
890 ret = btrfs_run_delayed_items(trans, fs_info); 889 ret = btrfs_run_delayed_items(trans);
891out: 890out:
892 kfree(name); 891 kfree(name);
893 iput(inode); 892 iput(inode);
@@ -1007,7 +1006,6 @@ static inline int __add_inode_ref(struct btrfs_trans_handle *trans,
1007 u64 ref_index, char *name, int namelen, 1006 u64 ref_index, char *name, int namelen,
1008 int *search_done) 1007 int *search_done)
1009{ 1008{
1010 struct btrfs_fs_info *fs_info = root->fs_info;
1011 int ret; 1009 int ret;
1012 char *victim_name; 1010 char *victim_name;
1013 int victim_name_len; 1011 int victim_name_len;
@@ -1065,7 +1063,7 @@ again:
1065 kfree(victim_name); 1063 kfree(victim_name);
1066 if (ret) 1064 if (ret)
1067 return ret; 1065 return ret;
1068 ret = btrfs_run_delayed_items(trans, fs_info); 1066 ret = btrfs_run_delayed_items(trans);
1069 if (ret) 1067 if (ret)
1070 return ret; 1068 return ret;
1071 *search_done = 1; 1069 *search_done = 1;
@@ -1136,8 +1134,7 @@ again:
1136 victim_name_len); 1134 victim_name_len);
1137 if (!ret) 1135 if (!ret)
1138 ret = btrfs_run_delayed_items( 1136 ret = btrfs_run_delayed_items(
1139 trans, 1137 trans);
1140 fs_info);
1141 } 1138 }
1142 iput(victim_parent); 1139 iput(victim_parent);
1143 kfree(victim_name); 1140 kfree(victim_name);
@@ -2098,7 +2095,6 @@ static noinline int check_item_in_log(struct btrfs_trans_handle *trans,
2098 struct inode *dir, 2095 struct inode *dir,
2099 struct btrfs_key *dir_key) 2096 struct btrfs_key *dir_key)
2100{ 2097{
2101 struct btrfs_fs_info *fs_info = root->fs_info;
2102 int ret; 2098 int ret;
2103 struct extent_buffer *eb; 2099 struct extent_buffer *eb;
2104 int slot; 2100 int slot;
@@ -2162,7 +2158,7 @@ again:
2162 ret = btrfs_unlink_inode(trans, root, BTRFS_I(dir), 2158 ret = btrfs_unlink_inode(trans, root, BTRFS_I(dir),
2163 BTRFS_I(inode), name, name_len); 2159 BTRFS_I(inode), name, name_len);
2164 if (!ret) 2160 if (!ret)
2165 ret = btrfs_run_delayed_items(trans, fs_info); 2161 ret = btrfs_run_delayed_items(trans);
2166 kfree(name); 2162 kfree(name);
2167 iput(inode); 2163 iput(inode);
2168 if (ret) 2164 if (ret)