[04/15] btrfs: sysfs, move declared struct near its use
diff mbox series

Message ID 20191118084656.3089-5-anand.jain@oracle.com
State New
Headers show
Series
  • btrfs: sysfs, cleanups
Related show

Commit Message

Anand Jain Nov. 18, 2019, 8:46 a.m. UTC
Move struct btrfs_feature_attr and struct raid_kobject near functions
and defines where its used. No functional change.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 fs/btrfs/sysfs.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

Comments

David Sterba Nov. 18, 2019, 3:40 p.m. UTC | #1
On Mon, Nov 18, 2019 at 04:46:45PM +0800, Anand Jain wrote:
> Move struct btrfs_feature_attr and struct raid_kobject near functions
> and defines where its used. No functional change.

No, please keep the definitions at the beginning of the file.

Patch
diff mbox series

diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index 1d58187a6b33..d54777d5c78e 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -19,18 +19,6 @@ 
 #include "space-info.h"
 #include "block-group.h"
 
-struct btrfs_feature_attr {
-	struct kobj_attribute kobj_attr;
-	enum btrfs_feature_set feature_set;
-	u64 feature_bit;
-};
-
-/* For raid type sysfs entries */
-struct raid_kobject {
-	u64 flags;
-	struct kobject kobj;
-};
-
 #define __INIT_KOBJ_ATTR(_name, _mode, _show, _store)			\
 {									\
 	.attr	= { .name = __stringify(_name), .mode = _mode },	\
@@ -49,6 +37,12 @@  struct raid_kobject {
 #define BTRFS_ATTR_PTR(_prefix, _name)					\
 	(&btrfs_attr_##_prefix##_##_name.attr)
 
+struct btrfs_feature_attr {
+	struct kobj_attribute kobj_attr;
+	enum btrfs_feature_set feature_set;
+	u64 feature_bit;
+};
+
 #define BTRFS_FEAT_ATTR(_name, _feature_set, _feature_prefix, _feature_bit)  \
 static struct btrfs_feature_attr btrfs_attr_features_##_name = {	     \
 	.kobj_attr = __INIT_KOBJ_ATTR(_name, S_IRUGO,			     \
@@ -394,6 +388,12 @@  static ssize_t global_rsv_reserved_show(struct kobject *kobj,
 }
 BTRFS_ATTR(allocation, global_rsv_reserved, global_rsv_reserved_show);
 
+/* For raid type sysfs entries */
+struct raid_kobject {
+	u64 flags;
+	struct kobject kobj;
+};
+
 #define to_space_info(_kobj) container_of(_kobj, struct btrfs_space_info, kobj)
 #define to_raid_kobj(_kobj) container_of(_kobj, struct raid_kobject, kobj)