diff options
author | David Sterba <dsterba@suse.com> | 2019-08-02 07:07:38 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-09-09 08:59:08 -0400 |
commit | 8f52316c271a572ef602e0b463d9d60d0f40276c (patch) | |
tree | c027f0a9214f590fb84ad13b713530f7a6e9a6a3 | |
parent | 67715b206c397b28b8a41c9ddbdc1776a0e7a25f (diff) |
btrfs: sysfs: move type conversion helpers to sysfs.c
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/sysfs.c | 16 | ||||
-rw-r--r-- | fs/btrfs/sysfs.h | 18 |
2 files changed, 16 insertions, 18 deletions
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index 85cf3bfc9f62..89781d941645 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c | |||
@@ -21,6 +21,22 @@ | |||
21 | static inline struct btrfs_fs_info *to_fs_info(struct kobject *kobj); | 21 | static inline struct btrfs_fs_info *to_fs_info(struct kobject *kobj); |
22 | static inline struct btrfs_fs_devices *to_fs_devs(struct kobject *kobj); | 22 | static inline struct btrfs_fs_devices *to_fs_devs(struct kobject *kobj); |
23 | 23 | ||
24 | static struct btrfs_feature_attr *to_btrfs_feature_attr(struct kobj_attribute *a) | ||
25 | { | ||
26 | return container_of(a, struct btrfs_feature_attr, kobj_attr); | ||
27 | } | ||
28 | |||
29 | static struct kobj_attribute *attr_to_btrfs_attr(struct attribute *attr) | ||
30 | { | ||
31 | return container_of(attr, struct kobj_attribute, attr); | ||
32 | } | ||
33 | |||
34 | static struct btrfs_feature_attr *attr_to_btrfs_feature_attr( | ||
35 | struct attribute *attr) | ||
36 | { | ||
37 | return to_btrfs_feature_attr(attr_to_btrfs_attr(attr)); | ||
38 | } | ||
39 | |||
24 | static u64 get_features(struct btrfs_fs_info *fs_info, | 40 | static u64 get_features(struct btrfs_fs_info *fs_info, |
25 | enum btrfs_feature_set set) | 41 | enum btrfs_feature_set set) |
26 | { | 42 | { |
diff --git a/fs/btrfs/sysfs.h b/fs/btrfs/sysfs.h index 611e103c174b..eaa37bd4013a 100644 --- a/fs/btrfs/sysfs.h +++ b/fs/btrfs/sysfs.h | |||
@@ -61,24 +61,6 @@ static struct btrfs_feature_attr btrfs_attr_features_##_name = { \ | |||
61 | #define BTRFS_FEAT_ATTR_INCOMPAT(name, feature) \ | 61 | #define BTRFS_FEAT_ATTR_INCOMPAT(name, feature) \ |
62 | BTRFS_FEAT_ATTR(name, FEAT_INCOMPAT, BTRFS_FEATURE_INCOMPAT, feature) | 62 | BTRFS_FEAT_ATTR(name, FEAT_INCOMPAT, BTRFS_FEATURE_INCOMPAT, feature) |
63 | 63 | ||
64 | /* convert from attribute */ | ||
65 | static inline struct btrfs_feature_attr * | ||
66 | to_btrfs_feature_attr(struct kobj_attribute *a) | ||
67 | { | ||
68 | return container_of(a, struct btrfs_feature_attr, kobj_attr); | ||
69 | } | ||
70 | |||
71 | static inline struct kobj_attribute *attr_to_btrfs_attr(struct attribute *attr) | ||
72 | { | ||
73 | return container_of(attr, struct kobj_attribute, attr); | ||
74 | } | ||
75 | |||
76 | static inline struct btrfs_feature_attr * | ||
77 | attr_to_btrfs_feature_attr(struct attribute *attr) | ||
78 | { | ||
79 | return to_btrfs_feature_attr(attr_to_btrfs_attr(attr)); | ||
80 | } | ||
81 | |||
82 | char *btrfs_printable_features(enum btrfs_feature_set set, u64 flags); | 64 | char *btrfs_printable_features(enum btrfs_feature_set set, u64 flags); |
83 | const char * const btrfs_feature_set_name(enum btrfs_feature_set set); | 65 | const char * const btrfs_feature_set_name(enum btrfs_feature_set set); |
84 | int btrfs_sysfs_add_device_link(struct btrfs_fs_devices *fs_devices, | 66 | int btrfs_sysfs_add_device_link(struct btrfs_fs_devices *fs_devices, |