aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/file.c
diff options
context:
space:
mode:
authorNikolay Borisov <[email protected]>2020-09-01 14:39:58 +0000
committerDavid Sterba <[email protected]>2020-10-07 10:13:18 +0000
commit3dc9dc8969dc738285cb7d43e852c98459c8f0a9 (patch)
treeea1c82d5921d5eb693da5eb98430aa0b28a27c21 /fs/btrfs/file.c
parentbtrfs: re-arrange statements in setup_items_for_insert (diff)
downloadkernel-3dc9dc8969dc738285cb7d43e852c98459c8f0a9.tar.gz
kernel-3dc9dc8969dc738285cb7d43e852c98459c8f0a9.zip
btrfs: eliminate total_size parameter from setup_items_for_insert
The value of this argument can be derived from the total_data as it's simply the value of the data size + size of btrfs_items being touched. Move the parameter calculation inside the function. This results in a simpler interface and also a minor size reduction: ./scripts/bloat-o-meter ctree.original fs/btrfs/ctree.o add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-34 (-34) Function old new delta btrfs_duplicate_item 260 259 -1 setup_items_for_insert 1200 1190 -10 btrfs_insert_empty_items 177 154 -23 Reviewed-by: Josef Bacik <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Nikolay Borisov <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r--fs/btrfs/file.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 32ceda264b7d..fefe152884fa 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -1057,10 +1057,7 @@ delete_extent_item:
if (btrfs_comp_cpu_keys(&key, &slot_key) > 0)
path->slots[0]++;
}
- setup_items_for_insert(root, path, &key,
- &extent_item_size,
- extent_item_size,
- sizeof(struct btrfs_item) +
+ setup_items_for_insert(root, path, &key, &extent_item_size,
extent_item_size, 1);
*key_inserted = 1;
}