]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: Simplify page unlocking in alloc_extent_buffer
authorNikolay Borisov <nborisov@suse.com>
Wed, 4 Jul 2018 07:24:51 +0000 (10:24 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 6 Aug 2018 11:12:54 +0000 (13:12 +0200)
commit08f652e1236ea40a0d05e8f413edf10819e53182
treee9fad71b6cdbe03a0e951596ae5f0a4b4f637f6d
parentcaebc53c3f93dcf3f9ab6679d681744a86abca39
btrfs: Simplify page unlocking in alloc_extent_buffer

Current version of the page unlocking code was added in
f8abc7420159 ("Btrfs: allow metadata blocks larger than the page size")
but even in this commit that particular flag was never used per-se. In
fact, btrfs only uses PageChecked for data pages to identify pages
which have been dirtied but don't have ORDERED bit set. For more
information see 247e743cbe6e ("Btrfs: Use async helpers to deal with
pages that have been improperly dirtied").

However, this doesn't apply to extent buffer pages. The important bit
here is that the pages are unlocked AFTER the extent buffer has been
properly recorded in the radix tree to avoid races with
btree_releasepage. Let's exploit this fact and simplify the page
unlocking sequence by unlocking the pages in-order and removing the
redundant PageChecked flag setting/clearing.

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