From: Zhao Lei Date: Thu, 25 Mar 2010 12:32:59 +0000 (+0000) Subject: Btrfs: Simplify num_stripes's calculation logical for __btrfs_alloc_chunk() X-Git-Tag: v3.0~4995^2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f3eae7e8a5ed124bbc781e18ea10c21856017322;p=platform%2Fkernel%2Flinux-amlogic.git Btrfs: Simplify num_stripes's calculation logical for __btrfs_alloc_chunk() We can use this simple method to make source more readable. Signed-off-by: Zhao Lei Signed-off-by: Miao Xie Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index c6c8009..bf3bec3 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)) {