mirror of
https://github.com/kdave/btrfs-progs
synced 2025-04-28 22:17:56 +00:00
btrfs-progs: export raid table helper for sub_stripes
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
833ce53872
commit
4f662d74fd
@ -238,6 +238,13 @@ int btrfs_bg_type_to_nparity(u64 flags)
|
|||||||
return btrfs_raid_array[index].nparity;
|
return btrfs_raid_array[index].nparity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int btrfs_bg_type_to_sub_stripes(u64 flags)
|
||||||
|
{
|
||||||
|
const int index = btrfs_bg_flags_to_raid_index(flags);
|
||||||
|
|
||||||
|
return btrfs_raid_array[index].sub_stripes;
|
||||||
|
}
|
||||||
|
|
||||||
static inline int nr_data_stripes(struct map_lookup *map)
|
static inline int nr_data_stripes(struct map_lookup *map)
|
||||||
{
|
{
|
||||||
return map->num_stripes - btrfs_bg_type_to_nparity(map->type);
|
return map->num_stripes - btrfs_bg_type_to_nparity(map->type);
|
||||||
|
@ -311,5 +311,6 @@ int btrfs_bg_type_to_tolerated_failures(u64 flags);
|
|||||||
int btrfs_bg_type_to_devs_min(u64 flags);
|
int btrfs_bg_type_to_devs_min(u64 flags);
|
||||||
int btrfs_bg_type_to_ncopies(u64 flags);
|
int btrfs_bg_type_to_ncopies(u64 flags);
|
||||||
int btrfs_bg_type_to_nparity(u64 flags);
|
int btrfs_bg_type_to_nparity(u64 flags);
|
||||||
|
int btrfs_bg_type_to_sub_stripes(u64 flags);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user