Skip to contentSkip to conversation

btrfs: Simplify num_stripes's calculation logical for __btrfs_alloc_chunk()

PATCH In review Miao Xie 1 participant 1 message Mar 25, 2010 Btrfs file system

lore
Share & tools
lore

Miao Xie

author
#0 lore raw

PATCH 8/18 btrfs: Simplify num_stripes's calculation logical for __btrfs_alloc_chunk()

From: Zhao Lei <[email protected]>

We can use this simple method to make source more readable.

---
 fs/btrfs/volumes.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
fs/btrfs/volumes.c +2 -2
index 844c393..3ae1f42 100644
@@ -2198,9 +2198,9 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
 		min_stripes = 2;
 	}
 	if (type & (BTRFS_BLOCK_GROUP_RAID1)) {
-		num_stripes = min_t(u64, 2, fs_devices->rw_devices);
-		if (num_stripes < 2)
+		if (fs_devices->rw_devices < 2)
 			return -ENOSPC;
+		num_stripes = 2;
 		min_stripes = 2;
 	}
 	if (type & (BTRFS_BLOCK_GROUP_RAID10)) {
Signature · 1 line
1.6.5.2