@@ -19,11 +19,11 @@
#ifndef __BTRFS_RAID56__
#define __BTRFS_RAID56__
-static inline int nr_parity_stripes(struct map_lookup *map)
+static inline int nr_parity_stripes(u64 type)
{
- if (map->type & BTRFS_BLOCK_GROUP_RAID5)
+ if (type & BTRFS_BLOCK_GROUP_RAID5)
return 1;
- else if (map->type & BTRFS_BLOCK_GROUP_RAID6)
+ else if (type & BTRFS_BLOCK_GROUP_RAID6)
return 2;
else
return 0;
@@ -31,7 +31,7 @@ static inline int nr_parity_stripes(struct map_lookup *map)
static inline int nr_data_stripes(struct map_lookup *map)
{
- return map->num_stripes - nr_parity_stripes(map);
+ return map->num_stripes - nr_parity_stripes(map->type);
}
#define RAID5_P_STRIPE ((u64)-2)
#define RAID6_Q_STRIPE ((u64)-1)
@@ -5181,7 +5181,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw,
/* RAID[56] write or recovery. Return all stripes */
num_stripes = map->num_stripes;
- max_errors = nr_parity_stripes(map);
+ max_errors = nr_parity_stripes(map->type);
raid_map = kmalloc_array(num_stripes, sizeof(u64),
GFP_NOFS);