From: David Sterba <dsterba@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.com>
Subject: [PATCH 13/13] btrfs: sysfs: move type conversion helpers to sysfs.c
Date: Fri, 2 Aug 2019 15:40:31 +0200 [thread overview]
Message-ID: <cfe92f777eb72d5f2e8d13f565c222d54f0bc682.1564752900.git.dsterba@suse.com> (raw)
In-Reply-To: <cover.1564752900.git.dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
---
fs/btrfs/sysfs.c | 17 +++++++++++++++++
fs/btrfs/sysfs.h | 18 ------------------
2 files changed, 17 insertions(+), 18 deletions(-)
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index e306e6e173cf..335450ad9d2d 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -69,6 +69,23 @@ static struct btrfs_feature_attr btrfs_attr_features_##_name = { \
static inline struct btrfs_fs_info *to_fs_info(struct kobject *kobj);
static inline struct btrfs_fs_devices *to_fs_devs(struct kobject *kobj);
+/* convert from attribute */
+static struct btrfs_feature_attr *to_btrfs_feature_attr(struct kobj_attribute *a)
+{
+ return container_of(a, struct btrfs_feature_attr, kobj_attr);
+}
+
+static struct kobj_attribute *attr_to_btrfs_attr(struct attribute *attr)
+{
+ return container_of(attr, struct kobj_attribute, attr);
+}
+
+static struct btrfs_feature_attr *attr_to_btrfs_feature_attr(
+ struct attribute *attr)
+{
+ return to_btrfs_feature_attr(attr_to_btrfs_attr(attr));
+}
+
static u64 get_features(struct btrfs_fs_info *fs_info,
enum btrfs_feature_set set)
{
diff --git a/fs/btrfs/sysfs.h b/fs/btrfs/sysfs.h
index ab0ea53b7d4b..b8513c5fb2b0 100644
--- a/fs/btrfs/sysfs.h
+++ b/fs/btrfs/sysfs.h
@@ -17,24 +17,6 @@ enum btrfs_feature_set {
FEAT_MAX
};
-/* convert from attribute */
-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);
const char * const btrfs_feature_set_name(enum btrfs_feature_set set);
int btrfs_sysfs_add_device_link(struct btrfs_fs_devices *fs_devices,
--
2.22.0
prev parent reply other threads:[~2019-08-02 13:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-02 13:40 [PATCH 00/13] Sysfs cleanups David Sterba
2019-08-02 13:40 ` [PATCH 01/13] btrfs: move sysfs declarations out of ctree.h David Sterba
2019-08-02 13:40 ` [PATCH 02/13] btrfs: move btrfs_add_raid_kobjects to sysfs.c David Sterba
2019-08-02 13:40 ` [PATCH 03/13] btrfs: factor sysfs code out of link_block_group David Sterba
2019-08-02 13:40 ` [PATCH 04/13] btrfs: sysfs: unexport btrfs_raid_ktype David Sterba
2019-08-02 13:40 ` [PATCH 05/13] btrfs: factor out sysfs code for creating space infos David Sterba
2019-08-02 13:40 ` [PATCH 06/13] btrfs: sysfs: unexport space_info_ktype David Sterba
2019-08-02 13:40 ` [PATCH 07/13] btrfs: sysfs: replace direct access to feature set names with a helper David Sterba
2019-08-02 13:40 ` [PATCH 08/13] btrfs: factor out sysfs code for sending device uevent David Sterba
2019-08-02 13:40 ` [PATCH 09/13] btrfs: factor out sysfs code for deleting block group and space infos David Sterba
2019-08-02 13:40 ` [PATCH 10/13] btrfs: factor out sysfs code for updating sprout fsid David Sterba
2019-08-02 13:40 ` [PATCH 11/13] btrfs: cleanup kobject.h includes David Sterba
2019-08-02 13:40 ` [PATCH 12/13] btrfs: sysfs: move helper macros to sysfs.c David Sterba
2019-08-02 13:40 ` David Sterba [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cfe92f777eb72d5f2e8d13f565c222d54f0bc682.1564752900.git.dsterba@suse.com \
--to=dsterba@suse.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).