diff options
author | David Sterba <dsterba@suse.com> | 2019-08-01 20:07:55 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-09-09 15:59:07 +0300 |
commit | f10152bcc962cae6e78ae4eecfa22270f481c0ff (patch) | |
tree | 31596741f22f7f5683f717ae214104fb308becd2 /fs/btrfs/sysfs.c | |
parent | 27992d014554c37aae1cf788fbf6c457b3eceb76 (diff) | |
download | linux-f10152bcc962cae6e78ae4eecfa22270f481c0ff.tar.xz |
btrfs: sysfs: replace direct access to feature set names with a helper
In order to unexport the feature type array, add a helper for the
enum-to-string conversion.
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/sysfs.c')
-rw-r--r-- | fs/btrfs/sysfs.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index bc82ab66ba8f..c7c29e5b38a0 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -675,12 +675,17 @@ void btrfs_sysfs_remove_mounted(struct btrfs_fs_info *fs_info) btrfs_sysfs_rm_device_link(fs_info->fs_devices, NULL); } -const char * const btrfs_feature_set_names[FEAT_MAX] = { +static const char * const btrfs_feature_set_names[FEAT_MAX] = { [FEAT_COMPAT] = "compat", [FEAT_COMPAT_RO] = "compat_ro", [FEAT_INCOMPAT] = "incompat", }; +const char * const btrfs_feature_set_name(enum btrfs_feature_set set) +{ + return btrfs_feature_set_names[set]; +} + char *btrfs_printable_features(enum btrfs_feature_set set, u64 flags) { size_t bufsize = 4096; /* safe max, 64 names * 64 bytes */ |