Skip to content

btrfs: prepare for variable stripe_len

Qu Wenruo linux-btrfs 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest9 patches 5 repliesIn review
  2. v19 patches 11 repliesSuperseded

Changes in v2 from the cover letter

- Use IS_ALINGED() when possible
Mostly affecting zoned.c

- Refactor is_same_chunk_map()
Not only reduce the length of the parameter list, but also make it easier to expand, with extra unlikely() calls.

- Refactor alloc_scrub_bbio()
Since the @private is always a scrub_stripe pointer, use scrub_stripe as the type instead, so we can grab stripe_len without introducing a new parameter.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9btrfs: reduce the width of num_stripes and sub_stripesfs/btrfs/volumes.h+4 -40 replies
2/9btrfs: load the on-disk btrfs_chunk::stripe_lenfs/btrfs/volumes.c fs/btrfs/volumes.h+13 -10 replies
3/9btrfs: add btrfs_io_context::stripe_len and load itfs/btrfs/volumes.c fs/btrfs/volumes.h+2 -00 replies
4/9btrfs: change scrub to use stripe_lenfs/btrfs/scrub.c+66 -331 reply
5/9btrfs: add a new 'stripe_len' parameter to btrfs_stripe_nr_to_offset()fs/btrfs/block-group.c fs/btrfs/scrub.c fs/btrfs/volumes.c +2 more+56 -311 reply
6/9btrfs: convert volumes.c and block-group.c to use map->stripe_lenfs/btrfs/block-group.c fs/btrfs/volumes.c+33 -251 reply
7/9btrfs: convert raid56.c to use rbio->bioc->stripe_lenfs/btrfs/raid56.c fs/btrfs/raid56.h+39 -251 reply
8/9btrfs: convert zoned.c to use map->stripe_lenfs/btrfs/zoned.c+30 -251 reply
9/9btrfs: introduce extra limits on btrfs_chunk::stripe_lenfs/btrfs/tree-checker.c+12 -10 replies

Reviews trailers per patch

All 9 patches have a Reviewed-by or Acked-by.

PatchJohannes Thumshirn
1/9R-b
2/9R-b
3/9R-b
4/9R-b
5/9R-b
6/9R-b
7/9R-b
8/9R-b
9/9R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/9] btrfs: prepare for variable stripe_len

[CHANGELOG]
v2:
- Use IS_ALINGED() when possible
Mostly affecting zoned.c

- Refactor is_same_chunk_map()
Not only reduce the length of the parameter list, but also make it easier to expand, with extra unlikely() calls.

- Refactor alloc_scrub_bbio()
Since the @private is always a scrub_stripe pointer, use scrub_stripe as the type instead, so we can grab stripe_len without introducing a new parameter.

All are suggested by Johannes.

This is a preparation patchset, to support a stripe_len that is not 64KiB.

This is for the future variable stripe length RAID56 feature, where RAID56_VSL profile is allowed for data chunks, and the stripe_len can be as small as sectorsize, meanwhile data IO are kept to be aligned to data_size, which is power of 2, and larger than sector size.

Finally, RAID56_VSL will always have a number of devices that nr_data == data_size / sector_size.

So that's why we want a variable stripe_len.

This series does all the preparation, including supporting stripe_len < PAGE_SIZE.

For now, tree-checker will still reject stripe_len != 64K, but that limit will be removed when RAID56_VSL feature is introduced and can be properly tested.

Qu Wenruo (9):
btrfs: reduce the width of num_stripes and sub_stripes
btrfs: load the on-disk btrfs_chunk::stripe_len
btrfs: add btrfs_io_context::stripe_len and load it
btrfs: change scrub to use stripe_len
btrfs: add a new 'stripe_len' parameter to btrfs_stripe_nr_to_offset()
btrfs: convert volumes.c and block-group.c to use map->stripe_len
btrfs: convert raid56.c to use rbio->bioc->stripe_len
btrfs: convert zoned.c to use map->stripe_len
btrfs: introduce extra limits on btrfs_chunk::stripe_len

 fs/btrfs/block-group.c  |   9 +--
 fs/btrfs/raid56.c       |  57 ++++++++++++------
 fs/btrfs/raid56.h       |   7 +--
 fs/btrfs/scrub.c        | 129 ++++++++++++++++++++++++++--------------
 fs/btrfs/tree-checker.c |  13 +++-
 fs/btrfs/volumes.c      |  95 +++++++++++++++++++----------
 fs/btrfs/volumes.h      |  16 +++--
 fs/btrfs/zoned.c        |  56 +++++++++--------
 8 files changed, 246 insertions(+), 136 deletions(-)
Signature · 1 line
2.56.0