summaryrefslogtreecommitdiff
path: root/fs/btrfs/ioctl.c
diff options
context:
space:
mode:
authorNikolay Borisov <nborisov@suse.com>2018-11-29 19:41:31 +0300
committerDavid Sterba <dsterba@suse.com>2018-12-17 16:51:49 +0300
commit61ed3a144aa75e76a3b0f75c2f49c81435e74621 (patch)
tree805a03861d79339eed44394ebe54ccd32453cf8e /fs/btrfs/ioctl.c
parent15c8276302c42ebf704b44578f25bc35dfdbde24 (diff)
downloadlinux-61ed3a144aa75e76a3b0f75c2f49c81435e74621.tar.xz
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