diff options
author | Jeff Mahoney <jeffm@suse.com> | 2016-06-21 21:16:51 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-12-06 10:06:57 -0500 |
commit | 6bccf3ab1e1f0913268bfcd1c09cadb1f4f2857d (patch) | |
tree | a7eae4bb4dec1cd2f7b21f5010549bfaa9aaa08c /fs/btrfs/root-tree.c | |
parent | 5b4aacefb8fbfc996e68b9b083d30f8bc0972449 (diff) |
btrfs: call functions that always use the same root with fs_info instead
There are many functions that are always called with the same root
argument. Rather than passing the same root every time, we can
pass an fs_info pointer instead and have the function get the root
pointer itself.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/root-tree.c')
-rw-r--r-- | fs/btrfs/root-tree.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c index edae751e870c..60e711ae044a 100644 --- a/fs/btrfs/root-tree.c +++ b/fs/btrfs/root-tree.c | |||
@@ -216,8 +216,9 @@ int btrfs_insert_root(struct btrfs_trans_handle *trans, struct btrfs_root *root, | |||
216 | return btrfs_insert_item(trans, root, key, item, sizeof(*item)); | 216 | return btrfs_insert_item(trans, root, key, item, sizeof(*item)); |
217 | } | 217 | } |
218 | 218 | ||
219 | int btrfs_find_orphan_roots(struct btrfs_root *tree_root) | 219 | int btrfs_find_orphan_roots(struct btrfs_fs_info *fs_info) |
220 | { | 220 | { |
221 | struct btrfs_root *tree_root = fs_info->tree_root; | ||
221 | struct extent_buffer *leaf; | 222 | struct extent_buffer *leaf; |
222 | struct btrfs_path *path; | 223 | struct btrfs_path *path; |
223 | struct btrfs_key key; | 224 | struct btrfs_key key; |
@@ -358,11 +359,12 @@ out: | |||
358 | } | 359 | } |
359 | 360 | ||
360 | int btrfs_del_root_ref(struct btrfs_trans_handle *trans, | 361 | int btrfs_del_root_ref(struct btrfs_trans_handle *trans, |
361 | struct btrfs_root *tree_root, | 362 | struct btrfs_fs_info *fs_info, |
362 | u64 root_id, u64 ref_id, u64 dirid, u64 *sequence, | 363 | u64 root_id, u64 ref_id, u64 dirid, u64 *sequence, |
363 | const char *name, int name_len) | 364 | const char *name, int name_len) |
364 | 365 | ||
365 | { | 366 | { |
367 | struct btrfs_root *tree_root = fs_info->tree_root; | ||
366 | struct btrfs_path *path; | 368 | struct btrfs_path *path; |
367 | struct btrfs_root_ref *ref; | 369 | struct btrfs_root_ref *ref; |
368 | struct extent_buffer *leaf; | 370 | struct extent_buffer *leaf; |
@@ -429,10 +431,11 @@ out: | |||
429 | * Will return 0, -ENOMEM, or anything from the CoW path | 431 | * Will return 0, -ENOMEM, or anything from the CoW path |
430 | */ | 432 | */ |
431 | int btrfs_add_root_ref(struct btrfs_trans_handle *trans, | 433 | int btrfs_add_root_ref(struct btrfs_trans_handle *trans, |
432 | struct btrfs_root *tree_root, | 434 | struct btrfs_fs_info *fs_info, |
433 | u64 root_id, u64 ref_id, u64 dirid, u64 sequence, | 435 | u64 root_id, u64 ref_id, u64 dirid, u64 sequence, |
434 | const char *name, int name_len) | 436 | const char *name, int name_len) |
435 | { | 437 | { |
438 | struct btrfs_root *tree_root = fs_info->tree_root; | ||
436 | struct btrfs_key key; | 439 | struct btrfs_key key; |
437 | int ret; | 440 | int ret; |
438 | struct btrfs_path *path; | 441 | struct btrfs_path *path; |