summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.c
diff options
context:
space:
mode:
authorNikolay Borisov2018-07-04 09:24:51 +0200
committerDavid Sterba2018-08-06 13:12:54 +0200
commit28187ae569e8a6c34eb7ac8871f479d94be31e16 (patch)
treee9fad71b6cdbe03a0e951596ae5f0a4b4f637f6d /fs/btrfs/extent_io.c
parentbtrfs: scrub: cleanup the remaining nodatasum fixup code (diff)
downloadkernel-qcow2-linux-28187ae569e8a6c34eb7ac8871f479d94be31e16.tar.gz
kernel-qcow2-linux-28187ae569e8a6c34eb7ac8871f479d94be31e16.tar.xz
kernel-qcow2-linux-28187ae569e8a6c34eb7ac8871f479d94be31e16.zip
btrfs: Simplify page unlocking in alloc_extent_buffer
Current version of the page unlocking code was added in 727011e07cbd ("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>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r--fs/btrfs/extent_io.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index fea015be4ce1..e9c74ce9623f 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -5047,13 +5047,8 @@ again:
* after the extent buffer is in the radix tree so
* it doesn't get lost
*/
- SetPageChecked(eb->pages[0]);
- for (i = 1; i < num_pages; i++) {
- p = eb->pages[i];
- ClearPageChecked(p);
- unlock_page(p);
- }
- unlock_page(eb->pages[0]);
+ for (i = 0; i < num_pages; i++)
+ unlock_page(eb->pages[i]);
return eb;
free_eb: