summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/sysfs.h
diff options
context:
space:
mode:
authorAnand Jain <Anand.Jain@oracle.com>2014-07-30 20:04:08 +0800
committerChris Mason <clm@fb.com>2014-09-17 13:37:58 -0700
commit98b3d389eb473f28ef69547c0a9f72041c4c40e6 (patch)
tree50cb465af49f0c2ebe023f34c3599310d6da4956 /fs/btrfs/sysfs.h
parent3f4b57e09d6cbd97f92311a801e1b83992506dcd (diff)
downloadop-kernel-dev-98b3d389eb473f28ef69547c0a9f72041c4c40e6.zip
op-kernel-dev-98b3d389eb473f28ef69547c0a9f72041c4c40e6.tar.gz
btrfs: code optimize: BTRFS_ATTR could handle the mode
All that uses BTRFS_ATTR want mode to be set at 0444 so just do it at the define. And few spacing alignments. Signed-off-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/sysfs.h')
-rw-r--r--fs/btrfs/sysfs.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/btrfs/sysfs.h b/fs/btrfs/sysfs.h
index ac46df3..531b11e 100644
--- a/fs/btrfs/sysfs.h
+++ b/fs/btrfs/sysfs.h
@@ -21,15 +21,18 @@ enum btrfs_feature_set {
}
#define BTRFS_ATTR_RW(_name, _mode, _show, _store) \
-static struct kobj_attribute btrfs_attr_##_name = \
+ static struct kobj_attribute btrfs_attr_##_name = \
__INIT_KOBJ_ATTR(_name, _mode, _show, _store)
-#define BTRFS_ATTR(_name, _mode, _show) \
- BTRFS_ATTR_RW(_name, _mode, _show, NULL)
+
+#define BTRFS_ATTR(_name, _show) \
+ BTRFS_ATTR_RW(_name, 0444, _show, NULL)
+
#define BTRFS_ATTR_PTR(_name) (&btrfs_attr_##_name.attr)
#define BTRFS_RAID_ATTR(_name, _show) \
-static struct kobj_attribute btrfs_raid_attr_##_name = \
+ static struct kobj_attribute btrfs_raid_attr_##_name = \
__INIT_KOBJ_ATTR(_name, 0444, _show, NULL)
+
#define BTRFS_RAID_ATTR_PTR(_name) (&btrfs_raid_attr_##_name.attr)
OpenPOWER on IntegriCloud