]> www.infradead.org Git - users/jedix/linux-maple.git/commit
btrfs: use num_extent_folios() in for loop bounds
authorDavid Sterba <dsterba@suse.com>
Tue, 25 Feb 2025 17:24:46 +0000 (18:24 +0100)
committerDavid Sterba <dsterba@suse.com>
Tue, 18 Mar 2025 19:35:47 +0000 (20:35 +0100)
commitbd06bce1b387c57210afb238e538dd4d4acb4dbc
tree0a95e5212db5c7c09e47fb33bfdd1ce33b40d027
parent6e7c2838632cc06b299297ee2477d05158838956
btrfs: use num_extent_folios() in for loop bounds

As the helper num_extent_folios() is now __pure, we can use it in for
loop without storing its value in a variable explicitly, the compiler
will do this for us.

The effects on btrfs.ko is -200 bytes and there are stack space savings
too:

btrfs_clone_extent_buffer                               -8 (32 -> 24)
btrfs_clear_buffer_dirty                                -8 (48 -> 40)
clear_extent_buffer_uptodate                            -8 (40 -> 32)
set_extent_buffer_dirty                                 -8 (32 -> 24)
write_one_eb                                            -8 (88 -> 80)
set_extent_buffer_uptodate                              -8 (40 -> 32)
read_extent_buffer_pages_nowait                        -16 (64 -> 48)
find_extent_buffer                                      -8 (32 -> 24)

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c
fs/btrfs/extent_io.c