* [PATCH 08/18] btrfs: Simplify num_stripes's calculation logical for __btrfs_alloc_chunk()
@ 2010-03-25 12:32 Miao Xie
  0 siblings, 0 replies; only message in thread
From: Miao Xie @ 2010-03-25 12:32 UTC (permalink / raw)
  To: Chris Mason; +Cc: Linux Btrfs
From: Zhao Lei <zhaolei@cn.fujitsu.com>
We can use this simple method to make source more readable.
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
---
 fs/btrfs/volumes.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 844c393..3ae1f42 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -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)) {
-- 
1.6.5.2
^ permalink raw reply related	[flat|nested] only message in thread
only message in thread, other threads:[~2010-03-25 12:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-25 12:32 [PATCH 08/18] btrfs: Simplify num_stripes's calculation logical for __btrfs_alloc_chunk() Miao Xie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).