]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
btrfs: xattr: remove unnecessary call to btrfs_mark_buffer_dirty()
authorFilipe Manana <fdmanana@suse.com>
Wed, 18 Dec 2024 13:04:01 +0000 (13:04 +0000)
committerDavid Sterba <dsterba@suse.com>
Mon, 13 Jan 2025 13:53:20 +0000 (14:53 +0100)
The call to btrfs_mark_buffer_dirty() at btrfs_setxattr() is not
necessary as we have a path setup for writing with btrfs_search_slot()
having a 'cow' argument set to 1.

This just makes the code more verbose, confusing and add a little extra
overhead and well as increase the module's text size, so remove it.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/xattr.c

index bc18710d1dcfbbf015c6390959dcc47c1226019b..3e0edbcf73e106d47cc201b1a85de9d90f65a368 100644 (file)
@@ -204,7 +204,6 @@ int btrfs_setxattr(struct btrfs_trans_handle *trans, struct inode *inode,
                btrfs_set_dir_data_len(leaf, di, size);
                data_ptr = ((unsigned long)(di + 1)) + name_len;
                write_extent_buffer(leaf, value, data_ptr, size);
-               btrfs_mark_buffer_dirty(trans, leaf);
        } else {
                /*
                 * Insert, and we had space for the xattr, so path->slots[0] is