Skip to content

RAID/volumes code cleanups

David Sterba linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest15 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15btrfs: fix minimum number of chunk errors for DUPfs/btrfs/volumes.c+1 -21 reply
2/15btrfs: raid56: allow the exact minimum number of devices for balance convertfs/btrfs/volumes.c+4 -30 replies
3/15btrfs: remove mapping tree structures indirectionfs/btrfs/ctree.h fs/btrfs/dev-replace.c fs/btrfs/disk-io.c +5 more+40 -500 replies
4/15btrfs: use raid_attr table in get_profile_num_devsfs/btrfs/extent-tree.c+2 -80 replies
5/15btrfs: use raid_attr in btrfs_chunk_max_errorsfs/btrfs/volumes.c+2 -120 replies
6/15btrfs: use raid_attr table in calc_stripe_length for nparityfs/btrfs/volumes.c+5 -103 replies
7/15btrfs: use raid_attr to get allowed profiles for balance conversionfs/btrfs/volumes.c+5 -90 replies
8/15btrfs: use raid_attr table to find profiles for integrity loweringfs/btrfs/volumes.c+10 -50 replies
9/15btrfs: use raid_attr table for btrfs_bg_type_to_factorfs/btrfs/volumes.c+3 -40 replies
10/15btrfs: factor out helper for counting data stripesfs/btrfs/volumes.c+15 -100 replies
11/15btrfs: use u8 for raid_array membersfs/btrfs/disk-io.c fs/btrfs/volumes.h+11 -110 replies
12/15btrfs: factor out devs_max setting in __btrfs_alloc_chunkfs/btrfs/volumes.c+2 -60 replies
13/15btrfs: refactor helper for bg flags to name conversionfs/btrfs/extent-tree.c fs/btrfs/volumes.c fs/btrfs/volumes.h+15 -260 replies
14/15btrfs: constify map parameter for nr_parity_stripes and nr_data_stripesfs/btrfs/raid56.h+2 -20 replies
15/15btrfs: read number of data stripes from map only oncefs/btrfs/scrub.c fs/btrfs/volumes.c+13 -120 replies

Reviews trailers per patch

1 of 15 patches has a Reviewed-by or Acked-by.

PatchQu Wenruo
1/15R-b
2/15
3/15
4/15
5/15
6/15
7/15
8/15
9/15
10/15
11/15
12/15
13/15
14/15
15/15

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

Read the v1 thread

Cover letter [PATCH 00/15] RAID/volumes code cleanups

This is preparatory work for RAID1C3, making use of the raid_attr table that replaces the hand crafted if-else-if sequences and bit mask checks. Pluging a new bg profile is easy on top of that, though there are still some possible cleanups left.

There's one user-visible change, patch 2/15, where the balance filters allow conversion to the RAID56 profiles with the minimum number of devices. This is for consistency with mkfs/mount.

So this will work:

 $ mkfs.btrfs -d raid1 -m raid1 /dev/sda /dev/sdb
 $ mount dev/sda /mnt
 $ btrfs balance start -dconvert=raid5 -mconvert=raid5 /mnt

David Sterba (15):
btrfs: fix minimum number of chunk errors for DUP
btrfs: raid56: allow the exact minimum number of devices for balance
convert
btrfs: remove mapping tree structures indirection
btrfs: use raid_attr table in get_profile_num_devs
btrfs: use raid_attr in btrfs_chunk_max_errors
btrfs: use raid_attr table in calc_stripe_length for nparity
btrfs: use raid_attr to get allowed profiles for balance conversion
btrfs: use raid_attr table to find profiles for integrity lowering
btrfs: use raid_attr table for btrfs_bg_type_to_factor
btrfs: factor out helper for counting data stripes
btrfs: use u8 for raid_array members
btrfs: factor out devs_max setting in __btrfs_alloc_chunk
btrfs: refactor helper for bg flags to name conversion
btrfs: constify map parameter for nr_parity_stripes and
nr_data_stripes
btrfs: read number of data stripes from map only once

 fs/btrfs/ctree.h            |   6 +-
 fs/btrfs/dev-replace.c      |   2 +-
 fs/btrfs/disk-io.c          |   6 +-
 fs/btrfs/extent-tree.c      |  28 ++---
 fs/btrfs/free-space-cache.c |   2 +-
 fs/btrfs/raid56.h           |   4 +-
 fs/btrfs/scrub.c            |  16 +--
 fs/btrfs/volumes.c          | 202 ++++++++++++++++--------------------
 fs/btrfs/volumes.h          |  24 ++---
 9 files changed, 125 insertions(+), 165 deletions(-)
Signature · 1 line
2.21.0