Re: [PATCH 2/2] Btrfs: make raid attr array more readable

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

 



On Wed, Jan 16, 2013 at 07:33:15PM +0800, Miao Xie wrote:
> As the title said, this patch just make raid attr array more readable.

Nice cleanup, thanks.

> --- a/fs/btrfs/volumes.c
> +++ b/fs/btrfs/volumes.c
> @@ -3492,13 +3492,48 @@ static int btrfs_cmp_device_info(const void *a, const void *b)
>  }
>  
>  struct btrfs_raid_attr btrfs_raid_array[BTRFS_NR_RAID_TYPES] = {
> -	{ 1, 1, 2, 2, 2, 2 /* raid1 */ },

> +	[BTRFS_RAID_RAID1] = {
> +		.sub_stripes	= 1,
> +		.dev_stripes	= 1,
> +		.devs_max	= 2,

Unrelated, but I'm curious why is this set to 2 (and was before)? This
will give preference to the same 2 devices as long as there's space, so
the allocator will not spread the data over the device set. I'd expect
the same behaviour as in RAID10 profile here.

> +		.devs_min	= 2,
> +		.devs_increment	= 2,
> +		.ncopies	= 2,
> +	},

david
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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