[PATCH 15/15] btrfs-progs: consolidate num_stripes setting for striping RAID levels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



All striping RAID Levels use the same method to set the number of RAID
stripes, so consolidate it.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@xxxxxxx>
---
 volumes.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/volumes.c b/volumes.c
index ec31acd57aa7..7c57d6cb376e 100644
--- a/volumes.c
+++ b/volumes.c
@@ -1077,17 +1077,12 @@ static void init_alloc_chunk_ctl(struct btrfs_fs_info *info,
 		ctl->num_stripes = min(ctl->min_stripes, ctl->total_devs);
 		break;
 	case BTRFS_RAID_RAID0:
-		ctl->num_stripes = min(ctl->max_stripes, ctl->total_devs);
-		break;
 	case BTRFS_RAID_RAID10:
-		ctl->num_stripes = min(ctl->max_stripes, ctl->total_devs);
-		ctl->num_stripes &= ~(u32)1;
-		break;
 	case BTRFS_RAID_RAID5:
-		ctl->num_stripes = min(ctl->max_stripes, ctl->total_devs);
-		break;
 	case BTRFS_RAID_RAID6:
 		ctl->num_stripes = min(ctl->max_stripes, ctl->total_devs);
+		if (type == BTRFS_RAID_RAID10)
+			ctl->num_stripes &= ~(u32)1;
 		break;
 	default:
 		break;
-- 
2.26.2




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux