diff options
author | Jeff Mahoney <jeffm@suse.com> | 2016-06-22 04:16:51 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-12-06 18:06:57 +0300 |
commit | 6bccf3ab1e1f0913268bfcd1c09cadb1f4f2857d (patch) | |
tree | a7eae4bb4dec1cd2f7b21f5010549bfaa9aaa08c /fs/btrfs/root-tree.c | |
parent | 5b4aacefb8fbfc996e68b9b083d30f8bc0972449 (diff) | |
download | linux-6bccf3ab1e1f0913268bfcd1c09cadb1f4f2857d.tar.xz |
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, return btrfs_insert_item(trans, root, key, item, sizeof(*item)); } -int btrfs_find_orphan_roots(struct btrfs_root *tree_root) +int btrfs_find_orphan_roots(struct btrfs_fs_info *fs_info) { + struct btrfs_root *tree_root = fs_info->tree_root; struct extent_buffer *leaf; struct btrfs_path *path; struct btrfs_key key; @@ -358,11 +359,12 @@ out: } int btrfs_del_root_ref(struct btrfs_trans_handle *trans, - struct btrfs_root *tree_root, + struct btrfs_fs_info *fs_info, u64 root_id, u64 ref_id, u64 dirid, u64 *sequence, const char *name, int name_len) { + struct btrfs_root *tree_root = fs_info->tree_root; struct btrfs_path *path; struct btrfs_root_ref *ref; struct extent_buffer *leaf; @@ -429,10 +431,11 @@ out: * Will return 0, -ENOMEM, or anything from the CoW path */ int btrfs_add_root_ref(struct btrfs_trans_handle *trans, - struct btrfs_root *tree_root, + struct btrfs_fs_info *fs_info, u64 root_id, u64 ref_id, u64 dirid, u64 sequence, const char *name, int name_len) { + struct btrfs_root *tree_root = fs_info->tree_root; struct btrfs_key key; int ret; struct btrfs_path *path; |