On 2014/12/18 5:14, Goffredo Baroncelli wrote: > This is a preparation patch. > 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 <[email protected]>
Reviewed-by: Satoru Takeuchi <[email protected]> > --- > cmds-filesystem.c | 22 ---------------------- > utils.c | 22 ++++++++++++++++++++++ > utils.h | 2 ++ > 3 files changed, 24 insertions(+), 22 deletions(-) > > diff --git a/cmds-filesystem.c b/cmds-filesystem.c > index 253f105..d1afeba 100644 > --- a/cmds-filesystem.c > +++ b/cmds-filesystem.c > @@ -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; > diff --git a/utils.c b/utils.c > index 2a92416..19049bb 100644 > --- a/utils.c > +++ b/utils.c > @@ -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"; > + } > +} > diff --git a/utils.h b/utils.h > index 289e86b..bb8a449 100644 > --- a/utils.h > +++ b/utils.h > @@ -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 > -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
