btrfs: zoned: implement cloning for zoned device-replace
authorNaohiro Aota <naohiro.aota@wdc.com>
Thu, 4 Feb 2021 10:22:12 +0000 (19:22 +0900)
committerDavid Sterba <dsterba@suse.com>
Tue, 9 Feb 2021 01:46:07 +0000 (02:46 +0100)
commit6143c23ccced762d21a87ef5fa421ba876231131
treeddddec1971300c4c72f855105205970b118ecf2d
parent78ce9fc269af6e69c1399ab910ba6bc81c934f67
btrfs: zoned: implement cloning for zoned device-replace

This is 2/4 patch to implement device replace for zoned filesystems.

In zoned mode, a block group must be either copied (from the source
device to the target device) or cloned (to both devices).

Implement the cloning part. If a block group targeted by an IO is marked
to copy, we should not clone the IO to the destination device, because
the block group is eventually copied by the replace process.

This commit also handles cloning of device reset.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c
fs/btrfs/volumes.c
fs/btrfs/zoned.c