• Qu Wenruo's avatar
    btrfs: introduce end_bio_subpage_eb_writepage() function · 2f3186d8
    Qu Wenruo authored
    
    
    The new function, end_bio_subpage_eb_writepage(), will handle the
    metadata writeback endio.
    
    The major differences involved are:
    
    - How to grab extent buffer
      Now page::private is a pointer to btrfs_subpage, we can no longer grab
      extent buffer directly.
      Thus we need to use the bv_offset to locate the extent buffer manually
      and iterate through the whole range.
    
    - Use btrfs_subpage_end_writeback() caller
      This helper will handle the subpage writeback for us.
    
    Since this function is executed under endio context, when grabbing
    extent buffers it can't grab eb->refs_lock as that lock is not designed
    to be grabbed under hardirq context.
    
    So here introduce a helper, find_extent_buffer_nolock(), for such
    situation, and convert find_extent_buffer() to use that helper.
    Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    2f3186d8
extent_io.c 180 KB