From: Chris Mason Date: Tue, 5 Feb 2013 15:04:03 +0000 (-0500) Subject: Merge branch 'for-linus' into raid56-experimental X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=0e4e02636611dbf89a2f36320a32054f9936d6cb;p=linux-beck.git Merge branch 'for-linus' into raid56-experimental Conflicts: fs/btrfs/volumes.c Signed-off-by: Chris Mason --- 0e4e02636611dbf89a2f36320a32054f9936d6cb diff --cc fs/btrfs/volumes.c index 77620f2d8af9,15f6efdf6463..8818dc34c199 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@@ -3535,33 -3507,9 +3546,33 @@@ struct btrfs_raid_attr btrfs_raid_array { 1, 1, 2, 2, 2, 2 /* raid1 */ }, { 1, 2, 1, 1, 1, 2 /* dup */ }, { 1, 1, 0, 2, 1, 1 /* raid0 */ }, - { 1, 1, 0, 1, 1, 1 /* single */ }, + { 1, 1, 1, 1, 1, 1 /* single */ }, + { 1, 1, 0, 2, 1, 2 /* raid5 */ }, + { 1, 1, 0, 3, 1, 3 /* raid6 */ }, }; +static u32 find_raid56_stripe_len(u32 data_devices, u32 dev_stripe_target) +{ + /* TODO allow them to set a preferred stripe size */ + return 64 * 1024; +} + +static void check_raid56_incompat_flag(struct btrfs_fs_info *info, u64 type) +{ + u64 features; + + if (!(type & (BTRFS_BLOCK_GROUP_RAID5 | BTRFS_BLOCK_GROUP_RAID6))) + return; + + features = btrfs_super_incompat_flags(info->super_copy); + if (features & BTRFS_FEATURE_INCOMPAT_RAID56) + return; + + features |= BTRFS_FEATURE_INCOMPAT_RAID56; + btrfs_set_super_incompat_flags(info->super_copy, features); + printk(KERN_INFO "btrfs: setting RAID5/6 feature flag\n"); +} + static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans, struct btrfs_root *extent_root, struct map_lookup **map_ret,