diff options
author | Naohiro Aota <naohiro.aota@wdc.com> | 2021-08-19 15:19:17 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2021-10-26 20:07:59 +0300 |
commit | afba2bc036b0ed983bef6bd7c00c827e97d1ba31 (patch) | |
tree | 9a1a3e3d5ee8eb3c5b31bf8309ffc022b4402a88 /fs/btrfs/block-group.h | |
parent | dafc340dbd10a21c133f3b152cee6214fcfbf84a (diff) | |
download | linux-afba2bc036b0ed983bef6bd7c00c827e97d1ba31.tar.xz |
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>
Diffstat (limited to 'fs/btrfs/block-group.h')
-rw-r--r-- | fs/btrfs/block-group.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/block-group.h b/fs/btrfs/block-group.h index 265db2c316d3..f751b802b173 100644 --- a/fs/btrfs/block-group.h +++ b/fs/btrfs/block-group.h @@ -98,6 +98,7 @@ struct btrfs_block_group { unsigned int to_copy:1; unsigned int relocating_repair:1; unsigned int chunk_item_inserted:1; + unsigned int zone_is_active:1; int disk_cache_state; @@ -205,6 +206,7 @@ struct btrfs_block_group { u64 zone_capacity; u64 meta_write_pointer; struct map_lookup *physical_map; + struct list_head active_bg_list; }; static inline u64 btrfs_block_group_end(struct btrfs_block_group *block_group) |