]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
btrfs: get fs_info from trans in btrfs_create_tree
authorDavid Sterba <dsterba@suse.com>
Wed, 20 Mar 2019 12:20:49 +0000 (13:20 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 29 Apr 2019 17:02:41 +0000 (19:02 +0200)
We can read fs_info from the transaction and can drop it from the
parameters.

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c
fs/btrfs/disk-io.h
fs/btrfs/free-space-tree.c
fs/btrfs/qgroup.c
fs/btrfs/volumes.c

index 6fc09d24a7f1fb26ba2bfbac9b8abf056bd5da89..f5d0517a8563af34dd4d25ebeecf339430a7af27 100644 (file)
@@ -1266,9 +1266,9 @@ struct btrfs_root *btrfs_alloc_dummy_root(struct btrfs_fs_info *fs_info)
 #endif
 
 struct btrfs_root *btrfs_create_tree(struct btrfs_trans_handle *trans,
-                                    struct btrfs_fs_info *fs_info,
                                     u64 objectid)
 {
+       struct btrfs_fs_info *fs_info = trans->fs_info;
        struct extent_buffer *leaf;
        struct btrfs_root *tree_root = fs_info->tree_root;
        struct btrfs_root *root;
index a32158f0c2fc8ecef27ae15186082d24be0221c6..a0161aa1ea0b339c16c182d92c524f38312cf186 100644 (file)
@@ -134,7 +134,6 @@ void btrfs_cleanup_dirty_bgs(struct btrfs_transaction *trans,
 void btrfs_cleanup_one_transaction(struct btrfs_transaction *trans,
                                  struct btrfs_fs_info *fs_info);
 struct btrfs_root *btrfs_create_tree(struct btrfs_trans_handle *trans,
-                                    struct btrfs_fs_info *fs_info,
                                     u64 objectid);
 int btree_lock_page_hook(struct page *page, void *data,
                                void (*flush_fn)(void *));
index 4859e09d2af00fc760ddc22573f6f81290fe2a65..771126bc67bcf8293763b40ec502236fe6043e1f 100644 (file)
@@ -1150,7 +1150,7 @@ int btrfs_create_free_space_tree(struct btrfs_fs_info *fs_info)
                return PTR_ERR(trans);
 
        set_bit(BTRFS_FS_CREATING_FREE_SPACE_TREE, &fs_info->flags);
-       free_space_root = btrfs_create_tree(trans, fs_info,
+       free_space_root = btrfs_create_tree(trans,
                                            BTRFS_FREE_SPACE_TREE_OBJECTID);
        if (IS_ERR(free_space_root)) {
                ret = PTR_ERR(free_space_root);
index 95361ccaa488ef8d19a17aeee33532937cc258df..2f708f2c4e67d4e149c22ffda0184e6e43c72e8b 100644 (file)
@@ -918,8 +918,7 @@ int btrfs_quota_enable(struct btrfs_fs_info *fs_info)
        /*
         * initially create the quota tree
         */
-       quota_root = btrfs_create_tree(trans, fs_info,
-                                      BTRFS_QUOTA_TREE_OBJECTID);
+       quota_root = btrfs_create_tree(trans, BTRFS_QUOTA_TREE_OBJECTID);
        if (IS_ERR(quota_root)) {
                ret =  PTR_ERR(quota_root);
                btrfs_abort_transaction(trans, ret);
index c10e389b245fb2c469e75f765462da8223f241d8..0a816279a803ef964c1e25cd92ba12c7019d2b6c 100644 (file)
@@ -4620,8 +4620,7 @@ int btrfs_create_uuid_tree(struct btrfs_fs_info *fs_info)
        if (IS_ERR(trans))
                return PTR_ERR(trans);
 
-       uuid_root = btrfs_create_tree(trans, fs_info,
-                                     BTRFS_UUID_TREE_OBJECTID);
+       uuid_root = btrfs_create_tree(trans, BTRFS_UUID_TREE_OBJECTID);
        if (IS_ERR(uuid_root)) {
                ret = PTR_ERR(uuid_root);
                btrfs_abort_transaction(trans, ret);