@@ -157,28 +157,6 @@ static char *group_type_str(u64 flag)
}
}
-static char *group_profile_str(u64 flag)
-{
- switch (flag & BTRFS_BLOCK_GROUP_PROFILE_MASK) {
- case 0:
- return "single";
- case BTRFS_BLOCK_GROUP_RAID0:
- return "RAID0";
- case BTRFS_BLOCK_GROUP_RAID1:
- return "RAID1";
- case BTRFS_BLOCK_GROUP_RAID5:
- return "RAID5";
- case BTRFS_BLOCK_GROUP_RAID6:
- return "RAID6";
- case BTRFS_BLOCK_GROUP_DUP:
- return "DUP";
- case BTRFS_BLOCK_GROUP_RAID10:
- return "RAID10";
- default:
- return "unknown";
- }
-}
-
static int get_df(int fd, struct btrfs_ioctl_space_args **sargs_ret)
{
u64 count = 0;
@@ -2450,3 +2450,25 @@ int find_next_key(struct btrfs_path *path, struct btrfs_key *key)
}
return 1;
}
+
+char *group_profile_str(u64 flag)
+{
+ switch (flag & BTRFS_BLOCK_GROUP_PROFILE_MASK) {
+ case 0:
+ return "single";
+ case BTRFS_BLOCK_GROUP_RAID0:
+ return "RAID0";
+ case BTRFS_BLOCK_GROUP_RAID1:
+ return "RAID1";
+ case BTRFS_BLOCK_GROUP_RAID5:
+ return "RAID5";
+ case BTRFS_BLOCK_GROUP_RAID6:
+ return "RAID6";
+ case BTRFS_BLOCK_GROUP_DUP:
+ return "DUP";
+ case BTRFS_BLOCK_GROUP_RAID10:
+ return "RAID10";
+ default:
+ return "unknown";
+ }
+}
@@ -161,4 +161,6 @@ static inline u64 btrfs_min_dev_size(u32 leafsize)
int find_next_key(struct btrfs_path *path, struct btrfs_key *key);
+char *group_profile_str(u64 flag);
+
#endif
Move the group_profile_str() function from cmds-filesystem.c to utils.c to be re-used from other modules (in this case from mkfs.c) Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it> --- cmds-filesystem.c | 22 ---------------------- utils.c | 22 ++++++++++++++++++++++ utils.h | 2 ++ 3 files changed, 24 insertions(+), 22 deletions(-)