]> git.baikalelectronics.ru Git - kernel.git/commitdiff
btrfs: remove btrfs_delayed_extent_op::is_data
authorDavid Sterba <dsterba@suse.com>
Wed, 20 Mar 2019 10:49:40 +0000 (11:49 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 16 May 2022 15:17:31 +0000 (17:17 +0200)
The value of btrfs_delayed_extent_op::is_data is always false, we can
cascade the change and simplify code that depends on it, removing the
structure member eventually.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/delayed-ref.c
fs/btrfs/delayed-ref.h
fs/btrfs/extent-tree.c

index 4176df149d042707cbbde646382bdf43c5645400..99f37fca2e9605206ae71cdc4df5d50dd51c70f1 100644 (file)
@@ -930,7 +930,6 @@ int btrfs_add_delayed_tree_ref(struct btrfs_trans_handle *trans,
        is_system = (generic_ref->tree_ref.owning_root == BTRFS_CHUNK_TREE_OBJECTID);
 
        ASSERT(generic_ref->type == BTRFS_REF_METADATA && generic_ref->action);
-       BUG_ON(extent_op && extent_op->is_data);
        ref = kmem_cache_alloc(btrfs_delayed_tree_ref_cachep, GFP_NOFS);
        if (!ref)
                return -ENOMEM;
@@ -1103,8 +1102,7 @@ int btrfs_add_delayed_extent_op(struct btrfs_trans_handle *trans,
                return -ENOMEM;
 
        init_delayed_ref_head(head_ref, NULL, bytenr, num_bytes, 0, 0,
-                             BTRFS_UPDATE_DELAYED_HEAD, extent_op->is_data,
-                             false);
+                             BTRFS_UPDATE_DELAYED_HEAD, false, false);
        head_ref->extent_op = extent_op;
 
        delayed_refs = &trans->transaction->delayed_refs;
index 91a3aabad1507d751c40fb5ff11ebef60e8bdfa1..d6304b690ec4a1763fbbb0d022c48a05ec8331ba 100644 (file)
@@ -58,7 +58,6 @@ struct btrfs_delayed_extent_op {
        u8 level;
        bool update_key;
        bool update_flags;
-       bool is_data;
        u64 flags_to_set;
 };
 
index 6f4aecb71effbfd47831065076c007ab1069fd21..856c6252ef9f6c8b2d6c4c03b2961fbd7b6001e5 100644 (file)
@@ -1577,12 +1577,12 @@ static int run_delayed_extent_op(struct btrfs_trans_handle *trans,
        u32 item_size;
        int ret;
        int err = 0;
-       int metadata = !extent_op->is_data;
+       int metadata = 1;
 
        if (TRANS_ABORTED(trans))
                return 0;
 
-       if (metadata && !btrfs_fs_incompat(fs_info, SKINNY_METADATA))
+       if (!btrfs_fs_incompat(fs_info, SKINNY_METADATA))
                metadata = 0;
 
        path = btrfs_alloc_path();
@@ -2192,7 +2192,6 @@ int btrfs_set_disk_extent_flags(struct btrfs_trans_handle *trans,
        extent_op->flags_to_set = flags;
        extent_op->update_flags = true;
        extent_op->update_key = false;
-       extent_op->is_data = false;
        extent_op->level = level;
 
        ret = btrfs_add_delayed_extent_op(trans, eb->start, eb->len, extent_op);
@@ -4951,7 +4950,6 @@ struct extent_buffer *btrfs_alloc_tree_block(struct btrfs_trans_handle *trans,
                extent_op->flags_to_set = flags;
                extent_op->update_key = skinny_metadata ? false : true;
                extent_op->update_flags = true;
-               extent_op->is_data = false;
                extent_op->level = level;
 
                btrfs_init_generic_ref(&generic_ref, BTRFS_ADD_DELAYED_EXTENT,