summaryrefslogtreecommitdiff
path: root/fs/btrfs/volumes.h
diff options
context:
space:
mode:
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>2023-09-14 19:06:58 +0300
committerDavid Sterba <dsterba@suse.com>2023-10-12 17:44:09 +0300
commit02c372e1f016e5113217597ab37b399c4e407477 (patch)
tree2d0ae758389fa49c49b19a004ef8cf65fcba2415 /fs/btrfs/volumes.h
parent515020900d447796bc2f0f57064663617a11b65d (diff)
downloadlinux-02c372e1f016e5113217597ab37b399c4e407477.tar.xz
btrfs: add support for inserting raid stripe extents
Add support for inserting stripe extents into the raid stripe tree on completion of every write that needs an extra logical-to-physical translation when using RAID. Inserting the stripe extents happens after the data I/O has completed, this is done to a) support zone-append and b) rule out the possibility of a RAID-write-hole. Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/volumes.h')
-rw-r--r--fs/btrfs/volumes.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h
index 0704c64cea1d..000c56a3d2a2 100644
--- a/fs/btrfs/volumes.h
+++ b/fs/btrfs/volumes.h
@@ -390,12 +390,11 @@ struct btrfs_fs_devices {
struct btrfs_io_stripe {
struct btrfs_device *dev;
- union {
- /* Block mapping */
- u64 physical;
- /* For the endio handler */
- struct btrfs_io_context *bioc;
- };
+ /* Block mapping. */
+ u64 physical;
+ u64 length;
+ /* For the endio handler. */
+ struct btrfs_io_context *bioc;
};
struct btrfs_discard_stripe {
@@ -428,6 +427,11 @@ struct btrfs_io_context {
atomic_t error;
u16 max_errors;
+ u64 logical;
+ u64 size;
+ /* Raid stripe tree ordered entry. */
+ struct list_head rst_ordered_entry;
+
/*
* The total number of stripes, including the extra duplicated
* stripe for replace.