• Nikolay Borisov's avatar
    btrfs: Simplify page unlocking in alloc_extent_buffer · 28187ae5
    Nikolay Borisov authored
    Current version of the page unlocking code was added in
    727011e0 ("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 247e743c ("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: default avatarNikolay Borisov <nborisov@suse.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    28187ae5
extent_io.c 150 KB