diff options
author | Nikolay Borisov <nborisov@suse.com> | 2018-11-29 18:41:31 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-12-17 14:51:49 +0100 |
commit | 61ed3a144aa75e76a3b0f75c2f49c81435e74621 (patch) | |
tree | 805a03861d79339eed44394ebe54ccd32453cf8e /fs/btrfs/ioctl.c | |
parent | 15c8276302c42ebf704b44578f25bc35dfdbde24 (diff) | |
download | linux-61ed3a144aa75e76a3b0f75c2f49c81435e74621.tar.bz2 |
btrfs: Refactor main loop in extent_readpages
extent_readpages processes all pages in the readlist in batches of 16,
this is implemented by a single for loop but thanks to an if condition
the loop does 2 things based on whether we've filled the batch or not.
Additionally due to the structure of the code there is an additional
check which deals with partial batches.
Streamline all of this by explicitly using two loops. The outter one is
used to process all pages while the inner one just fills in the batch
of 16 (currently). Due to this new structure the code guarantees that
all pages are processed in the loop hence the code to deal with any
leftovers is eliminated.
This also enable the compiler to inline __extent_readpages:
./scripts/bloat-o-meter fs/btrfs/extent_io.o extent_io.for
add/remove: 0/1 grow/shrink: 1/0 up/down: 660/-820 (-160)
Function old new delta
extent_readpages 476 1136 +660
__extent_readpages 820 - -820
Total: Before=44315, After=44155, chg -0.36%
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/ioctl.c')
0 files changed, 0 insertions, 0 deletions