mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-22 15:03:53 +02:00
btrfs: free-space-tree: remove unnecessary calls to btrfs_mark_buffer_dirty()
We have several places explicitly calling btrfs_mark_buffer_dirty() but that is not necessarily since the target leaf came from a path that was obtained for a btree search function that modifies the btree, something ike btrfs_insert_empty_item() or anything else that ends up calling btrfs_search_slot() with a value of 1 for its 'cow' argument. These just make the code more verbose, confusing and add a little extra overhead and well as increase the module's text size, so remove them. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
8787c36c63
commit
63eb222387
|
@ -89,7 +89,6 @@ static int add_new_free_space_info(struct btrfs_trans_handle *trans,
|
|||
struct btrfs_free_space_info);
|
||||
btrfs_set_free_space_extent_count(leaf, info, 0);
|
||||
btrfs_set_free_space_flags(leaf, info, 0);
|
||||
btrfs_mark_buffer_dirty(trans, leaf);
|
||||
|
||||
ret = 0;
|
||||
out:
|
||||
|
@ -287,7 +286,6 @@ int convert_free_space_to_bitmaps(struct btrfs_trans_handle *trans,
|
|||
flags |= BTRFS_FREE_SPACE_USING_BITMAPS;
|
||||
btrfs_set_free_space_flags(leaf, info, flags);
|
||||
expected_extent_count = btrfs_free_space_extent_count(leaf, info);
|
||||
btrfs_mark_buffer_dirty(trans, leaf);
|
||||
btrfs_release_path(path);
|
||||
|
||||
if (extent_count != expected_extent_count) {
|
||||
|
@ -324,7 +322,6 @@ int convert_free_space_to_bitmaps(struct btrfs_trans_handle *trans,
|
|||
ptr = btrfs_item_ptr_offset(leaf, path->slots[0]);
|
||||
write_extent_buffer(leaf, bitmap_cursor, ptr,
|
||||
data_size);
|
||||
btrfs_mark_buffer_dirty(trans, leaf);
|
||||
btrfs_release_path(path);
|
||||
|
||||
i += extent_size;
|
||||
|
@ -430,7 +427,6 @@ int convert_free_space_to_extents(struct btrfs_trans_handle *trans,
|
|||
flags &= ~BTRFS_FREE_SPACE_USING_BITMAPS;
|
||||
btrfs_set_free_space_flags(leaf, info, flags);
|
||||
expected_extent_count = btrfs_free_space_extent_count(leaf, info);
|
||||
btrfs_mark_buffer_dirty(trans, leaf);
|
||||
btrfs_release_path(path);
|
||||
|
||||
nrbits = block_group->length >> block_group->fs_info->sectorsize_bits;
|
||||
|
@ -495,7 +491,6 @@ static int update_free_space_extent_count(struct btrfs_trans_handle *trans,
|
|||
|
||||
extent_count += new_extents;
|
||||
btrfs_set_free_space_extent_count(path->nodes[0], info, extent_count);
|
||||
btrfs_mark_buffer_dirty(trans, path->nodes[0]);
|
||||
btrfs_release_path(path);
|
||||
|
||||
if (!(flags & BTRFS_FREE_SPACE_USING_BITMAPS) &&
|
||||
|
|
Loading…
Reference in New Issue
Block a user