btrfs: zoned: introduce block group context to btrfs_eb_write_context
authorNaohiro Aota <naohiro.aota@wdc.com>
Mon, 7 Aug 2023 16:12:32 +0000 (01:12 +0900)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Aug 2023 12:52:19 +0000 (14:52 +0200)
commit7db94301a980c9da4168ac7ce61e7bde297306ba
tree1504e8b429f091f551ac82557907d7d2a0ddf9c4
parent861093eff4f01319edfc1d1ee276a7f2bf720f1d
btrfs: zoned: introduce block group context to btrfs_eb_write_context

For metadata write out on the zoned mode, we call
btrfs_check_meta_write_pointer() to check if an extent buffer to be written
is aligned to the write pointer.

We look up a block group containing the extent buffer for every extent
buffer, which takes unnecessary effort as the writing extent buffers are
mostly contiguous.

Introduce "zoned_bg" to cache the block group working on.  Also, while
at it, rename "cache" to "block_group".

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c
fs/btrfs/extent_io.h
fs/btrfs/zoned.c
fs/btrfs/zoned.h