summaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2025-10-12 17:48:27 +0100
committerDavid Sterba <dsterba@suse.com>2025-11-24 21:59:09 +0100
commitf1ae05b8eaf5b2049ef0f6bfff4376f793adeb83 (patch)
tree8905892f9cd8f2849e51c5e62cc986a35bace0d8 /tools/perf/scripts/python
parent3b7c0c20b72003238ea3e17e60e357513be8edaf (diff)
downloadlinux-f1ae05b8eaf5b2049ef0f6bfff4376f793adeb83.tar.gz
linux-f1ae05b8eaf5b2049ef0f6bfff4376f793adeb83.zip
btrfs: avoid repeated computations in btrfs_mark_ordered_io_finished()
We're computing a few values several times: 1) The current ordered extent's end offset inside the while loop, we have computed it and stored it in the 'entry_end' variable but then we compute it again later as the first argument to the min() macro; 2) The end file offset, open coded 3 times; 3) The current length (stored in variable 'len') computed 2 times, one inside an assertion and the other when assigning to the 'len' variable. So use existing variables and add new ones to prevent repeating these expressions and reduce the source code. We were also subtracting one from the result of min() macro call and then adding 1 back in the next line, making both operations pointless. So just remove the decrement and increment by 1. This also reduces very slightly the object code. Before: $ size fs/btrfs/btrfs.ko text data bss dec hex filename 1916576 161679 15592 2093847 1ff317 fs/btrfs/btrfs.ko After: $ size fs/btrfs/btrfs.ko text data bss dec hex filename 1916556 161679 15592 2093827 1ff303 fs/btrfs/btrfs.ko Reviewed-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Anand Jain <asj@kernel.org> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions