btrfs: zoned: implement active zone tracking
Add zone_is_active flag to btrfs_block_group. This flag indicates the underlying zones are all active. Such zone active block groups are tracked by fs_info->active_bg_list. btrfs_dev_{set,clear}_active_zone() take responsibility for the underlying device part. They set/clear the bitmap to indicate zone activeness and count the number of zones we can activate left. btrfs_zone_{activate,finish}() take responsibility for the logical part and the list management. In addition, btrfs_zone_finish() wait for any writes on it and send REQ_OP_ZONE_FINISH to the zone. Signed-off-by:Naohiro Aota <naohiro.aota@wdc.com> Signed-off-by:
David Sterba <dsterba@suse.com>
Showing
- fs/btrfs/block-group.c 11 additions, 0 deletionsfs/btrfs/block-group.c
- fs/btrfs/block-group.h 2 additions, 0 deletionsfs/btrfs/block-group.h
- fs/btrfs/ctree.h 3 additions, 0 deletionsfs/btrfs/ctree.h
- fs/btrfs/disk-io.c 2 additions, 0 deletionsfs/btrfs/disk-io.c
- fs/btrfs/free-space-cache.c 3 additions, 2 deletionsfs/btrfs/free-space-cache.c
- fs/btrfs/zoned.c 193 additions, 0 deletionsfs/btrfs/zoned.c
- fs/btrfs/zoned.h 12 additions, 0 deletionsfs/btrfs/zoned.h
Loading
Please register or sign in to comment