btrfs: Remove unnecessary call to btrfs_mark_buffer_dirty()
PATCH 1/1 btrfs: Remove unnecessary call to btrfs_mark_buffer_dirty()
When btrfs_insert_empty_item() succeeds, the leaf has already been marked dirty automatically through two mechanisms:
1) COW operations: btrfs_search_slot(cow=1)
2) setup_items_for_insert() → btrfs_mark_buffer_dirty(trans, leaf)
Therefore the explicit call in btrfs_insert_item() is redundant and can be safely removed. This removes unnecessary code verbosity, reduces overhead, and aligns with the cleanup done in commit 1ca4e15f41f2e ("btrfs: volumes: remove unnecessary calls to btrfs_mark_buffer_dirty()").
Signed-off-by Zhen Ni <[email protected]>
--- fs/btrfs/ctree.c | 1 - 1 file changed, 1 deletion(-)
fs/btrfs/ctree.c +0 -1
@@ -4324,7 +4324,6 @@ int btrfs_insert_item(struct btrfs_trans_handle *trans, struct btrfs_root *root, leaf = path->nodes[0 ]; ptr =btrfs_item_ptr_offset (leaf, path->slots[0 ]);write_extent_buffer (leaf, data, ptr, data_size); -btrfs_mark_buffer_dirty (trans, leaf); }return ret; }
Signature · 1 line
2.20.1