From 6bccf3ab1e1f0913268bfcd1c09cadb1f4f2857d Mon Sep 17 00:00:00 2001 From: Jeff Mahoney Date: Tue, 21 Jun 2016 21:16:51 -0400 Subject: 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 Signed-off-by: David Sterba --- fs/btrfs/root-tree.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'fs/btrfs/root-tree.c') 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; -- cgit v1.2.3