forked from Minki/linux
btrfs: remove btrfs_delayed_extent_op::is_data
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>
This commit is contained in:
parent
2fe6a5a1d2
commit
0e3696f80f
@ -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);
|
is_system = (generic_ref->tree_ref.owning_root == BTRFS_CHUNK_TREE_OBJECTID);
|
||||||
|
|
||||||
ASSERT(generic_ref->type == BTRFS_REF_METADATA && generic_ref->action);
|
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);
|
ref = kmem_cache_alloc(btrfs_delayed_tree_ref_cachep, GFP_NOFS);
|
||||||
if (!ref)
|
if (!ref)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
@ -1103,8 +1102,7 @@ int btrfs_add_delayed_extent_op(struct btrfs_trans_handle *trans,
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
init_delayed_ref_head(head_ref, NULL, bytenr, num_bytes, 0, 0,
|
init_delayed_ref_head(head_ref, NULL, bytenr, num_bytes, 0, 0,
|
||||||
BTRFS_UPDATE_DELAYED_HEAD, extent_op->is_data,
|
BTRFS_UPDATE_DELAYED_HEAD, false, false);
|
||||||
false);
|
|
||||||
head_ref->extent_op = extent_op;
|
head_ref->extent_op = extent_op;
|
||||||
|
|
||||||
delayed_refs = &trans->transaction->delayed_refs;
|
delayed_refs = &trans->transaction->delayed_refs;
|
||||||
|
@ -58,7 +58,6 @@ struct btrfs_delayed_extent_op {
|
|||||||
u8 level;
|
u8 level;
|
||||||
bool update_key;
|
bool update_key;
|
||||||
bool update_flags;
|
bool update_flags;
|
||||||
bool is_data;
|
|
||||||
u64 flags_to_set;
|
u64 flags_to_set;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1577,12 +1577,12 @@ static int run_delayed_extent_op(struct btrfs_trans_handle *trans,
|
|||||||
u32 item_size;
|
u32 item_size;
|
||||||
int ret;
|
int ret;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
int metadata = !extent_op->is_data;
|
int metadata = 1;
|
||||||
|
|
||||||
if (TRANS_ABORTED(trans))
|
if (TRANS_ABORTED(trans))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (metadata && !btrfs_fs_incompat(fs_info, SKINNY_METADATA))
|
if (!btrfs_fs_incompat(fs_info, SKINNY_METADATA))
|
||||||
metadata = 0;
|
metadata = 0;
|
||||||
|
|
||||||
path = btrfs_alloc_path();
|
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->flags_to_set = flags;
|
||||||
extent_op->update_flags = true;
|
extent_op->update_flags = true;
|
||||||
extent_op->update_key = false;
|
extent_op->update_key = false;
|
||||||
extent_op->is_data = false;
|
|
||||||
extent_op->level = level;
|
extent_op->level = level;
|
||||||
|
|
||||||
ret = btrfs_add_delayed_extent_op(trans, eb->start, eb->len, extent_op);
|
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->flags_to_set = flags;
|
||||||
extent_op->update_key = skinny_metadata ? false : true;
|
extent_op->update_key = skinny_metadata ? false : true;
|
||||||
extent_op->update_flags = true;
|
extent_op->update_flags = true;
|
||||||
extent_op->is_data = false;
|
|
||||||
extent_op->level = level;
|
extent_op->level = level;
|
||||||
|
|
||||||
btrfs_init_generic_ref(&generic_ref, BTRFS_ADD_DELAYED_EXTENT,
|
btrfs_init_generic_ref(&generic_ref, BTRFS_ADD_DELAYED_EXTENT,
|
||||||
|
Loading…
Reference in New Issue
Block a user