• Naohiro Aota's avatar
    btrfs: zoned: extend zoned allocator to use dedicated tree-log block group · 40ab3be1
    Naohiro Aota authored
    This is the 1/3 patch to enable tree log on zoned filesystems.
    
    The tree-log feature does not work on a zoned filesystem as is. Blocks for
    a tree-log tree are allocated mixed with other metadata blocks and btrfs
    writes and syncs the tree-log blocks to devices at the time of fsync(),
    which has a different timing than a global transaction commit. As a
    result, both writing tree-log blocks and writing other metadata blocks
    become non-sequential writes that zoned filesystems must avoid.
    
    Introduce a dedicated block group for tree-log blocks, so that tree-log
    blocks and other metadata blocks can be separate write streams.  As a
    result, each write stream can now be written to devices separately.
    "fs_info->treelog_bg" tracks the dedicated block group and assigns
    "treelog_bg" on-demand on tree-log block allocation time.
    
    This commit extends the zoned block allocator to use the block group.
    Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Signed-off-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
    Signed-off-by: default avatarNaohiro Aota <naohiro.aota@wdc.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    40ab3be1
extent-tree.c 163 KB