• Qu Wenruo's avatar
    btrfs: migrate get_eb_page_index() and get_eb_offset_in_page() to folios · 8d993618
    Qu Wenruo authored
    These two functions are still using the old page based code, which is
    not going to handle larger folios at all.
    
    The migration itself is going to involve the following changes:
    
    - PAGE_SIZE -> folio_size()
    - PAGE_SHIFT -> folio_shift()
    - get_eb_page_index() -> get_eb_folio_index()
    - get_eb_offset_in_page() -> get_eb_offset_in_folio()
    
    And since we're going to support larger folios, although above straight
    conversion is good enough, this patch would add extra comments in the
    involved functions to explain why the same single line code can now
    cover 3 cases:
    
    - folio_size == PAGE_SIZE, sectorsize == PAGE_SIZE, nodesize >= PAGE_SIZE
      The common, non-subpage case with per-page folio.
    
    - folio_size > PAGE_SIZE, sectorsize == PAGE_SIZE, nodesize >= PAGE_SIZE
      The incoming larger folio, non-subpage case.
    
    - folio_size == PAGE_SIZE, sectorsize < PAGE_SIZE, nodesize < PAGE_SIZE
      The existing subpage case, we won't larger folio anyway.
    Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    8d993618
disk-io.c 138 KB