summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/sysfs.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2015-06-10 12:44:58 +0200
committerJohannes Berg <johannes.berg@intel.com>2015-06-10 12:45:09 +0200
commit206c59d1d7d42bcafc1d7f1e476e87e4427e2345 (patch)
treea2f99470bd0fe43f5cf57812fca969bb3ca3c451 /fs/btrfs/sysfs.h
parentmac80211: Fix a case of incorrect metric used when forwarding a PREQ (diff)
parentMerge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-merge (diff)
downloadlinux-206c59d1d7d42bcafc1d7f1e476e87e4427e2345.tar.xz
linux-206c59d1d7d42bcafc1d7f1e476e87e4427e2345.zip
Merge remote-tracking branch 'net-next/master' into mac80211-next
Merge back net-next to get wireless driver changes (from Kalle) to be able to create the API change across all trees properly. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'fs/btrfs/sysfs.h')
-rw-r--r--fs/btrfs/sysfs.h22
1 files changed, 17 insertions, 5 deletions
diff --git a/fs/btrfs/sysfs.h b/fs/btrfs/sysfs.h
index f7dd298b3cf6..3a4bbed723fd 100644
--- a/fs/btrfs/sysfs.h
+++ b/fs/btrfs/sysfs.h
@@ -61,11 +61,23 @@ static struct btrfs_feature_attr btrfs_attr_##_name = { \
BTRFS_FEAT_ATTR(name, FEAT_INCOMPAT, BTRFS_FEATURE_INCOMPAT, feature)
/* convert from attribute */
-#define to_btrfs_feature_attr(a) \
- container_of(a, struct btrfs_feature_attr, kobj_attr)
-#define attr_to_btrfs_attr(a) container_of(a, struct kobj_attribute, attr)
-#define attr_to_btrfs_feature_attr(a) \
- to_btrfs_feature_attr(attr_to_btrfs_attr(a))
+static inline struct btrfs_feature_attr *
+to_btrfs_feature_attr(struct kobj_attribute *a)
+{
+ return container_of(a, struct btrfs_feature_attr, kobj_attr);
+}
+
+static inline struct kobj_attribute *attr_to_btrfs_attr(struct attribute *attr)
+{
+ return container_of(attr, struct kobj_attribute, attr);
+}
+
+static inline struct btrfs_feature_attr *
+attr_to_btrfs_feature_attr(struct attribute *attr)
+{
+ return to_btrfs_feature_attr(attr_to_btrfs_attr(attr));
+}
+
char *btrfs_printable_features(enum btrfs_feature_set set, u64 flags);
extern const char * const btrfs_feature_set_names[3];
extern struct kobj_type space_info_ktype;