]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: Refactor loop in btrfs_release_extent_buffer_page
authorNikolay Borisov <nborisov@suse.com>
Wed, 27 Jun 2018 13:38:22 +0000 (16:38 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 6 Aug 2018 11:12:54 +0000 (13:12 +0200)
commite293164b03ba3d0477761835ba82de6c7e0ad1ec
tree0c73282c2f98a96b7e89750be2ffcd639357cd9b
parente1cf542925ccd34e01d3d7fc4f0ec036138a3636
btrfs: Refactor loop in btrfs_release_extent_buffer_page

The purpose of the function is to free all the pages comprising an
extent buffer. This can be achieved with a simple for loop rather than
the slightly more involved 'do {} while' construct. So rewrite the
loop using a 'for' construct. Additionally we can never have an
extent_buffer that has 0 pages so remove the check for index == 0. No
functional changes.

The reversed order used to have a meaning in the past where the first
page served as a blocking point for several callers. See eg
4b92bad28b14669d44ecdfdd ("Btrfs: set page->private to the eb").

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c