• Naohiro Aota's avatar
    btrfs: zoned: load zone's allocation offset · 08e11a3d
    Naohiro Aota authored
    A zoned filesystem must allocate blocks at the zones' write pointer. The
    device's write pointer position can be mapped to a logical address within
    a block group. To facilitate this, add an "alloc_offset" to the
    block-group to track the logical addresses of the write pointer.
    
    This logical address is populated in btrfs_load_block_group_zone_info()
    from the write pointers of corresponding zones.
    
    For now, zoned filesystems the single profile. Supporting non-single
    profile with zone append writing is not trivial. For example, in the DUP
    profile, we send a zone append writing IO to two zones on a device. The
    device reply with written LBAs for the IOs. If the offsets of the
    returned addresses from the beginning of the zone are different, then it
    results in different logical addresses.
    
    We need fine-grained logical to physical mapping to support such separated
    physical address issue. Since it should require additional metadata type,
    disable non-single profiles for now.
    
    This commit supports the case all the zones in a block group are
    sequential. The next patch will handle the case having a conventional
    zone.
    Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Reviewed-by: default avatarAnand Jain <anand.jain@oracle.com>
    Signed-off-by: default avatarNaohiro Aota <naohiro.aota@wdc.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    08e11a3d
block-group.h 10.1 KB