]> git.hungrycats.org Git - linux/commitdiff
btrfs: add btrfs_io_context::stripe_len and load it
authorQu Wenruo <wqu@suse.com>
Wed, 21 Oct 2026 03:39:37 +0000 (14:09 +1030)
committerDavid Sterba <dsterba@suse.com>
Fri, 30 Oct 2026 20:36:18 +0000 (21:36 +0100)
The new member will be utilized by various path that no direct
btrfs_chunk_map is available, but a stripe length is still required.

The new member is located inside a hole between @refs and @fs_info, so
no size increase for btrfs_io_context.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c
fs/btrfs/volumes.h

index a30b212ef0f1deed72e6662a21b5da6d05ad4ad6..ff7189ac1c49112a6dbd0aab96b3139f3a873ef3 100644 (file)
@@ -7411,6 +7411,7 @@ int btrfs_map_block(struct btrfs_fs_info *fs_info, enum btrfs_map_op op,
                ret = -ENOMEM;
                goto out;
        }
+       bioc->stripe_len = map->stripe_len;
        bioc->map_type = map->type;
        bioc->use_rst = io_geom.use_rst;
 
index 9dcc14cd61e2f2b00f17cec169a60213e03bb64e..9356cec00a90079091f67d2fabcf5b49366b895b 100644 (file)
@@ -515,6 +515,7 @@ struct btrfs_discard_stripe {
  */
 struct btrfs_io_context {
        refcount_t refs;
+       u32 stripe_len;
        struct btrfs_fs_info *fs_info;
        /* Taken from struct btrfs_chunk_map::type. */
        u64 map_type;