diff options
author | Anand Jain <Anand.Jain@oracle.com> | 2014-07-30 08:04:09 -0400 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-09-17 16:37:59 -0400 |
commit | 20ee0825ecec889afdf12f7c13b9dc3af0bb9f14 (patch) | |
tree | bad80d3fef77e61371739a629662a763c7bf0f2b /fs/btrfs | |
parent | 98b3d389eb473f28ef69547c0a9f72041c4c40e6 (diff) |
btrfs: code optimize: BTRFS_ATTR_RW could set the mode
BTRFS_ATTR_RW could set the mode and be inline with BTRFS_ATTR
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/sysfs.c | 2 | ||||
-rw-r--r-- | fs/btrfs/sysfs.h | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index a1c10886d9f2..e6a5e7d82f42 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c | |||
@@ -401,7 +401,7 @@ static ssize_t btrfs_label_store(struct kobject *kobj, | |||
401 | 401 | ||
402 | return ret; | 402 | return ret; |
403 | } | 403 | } |
404 | BTRFS_ATTR_RW(label, 0644, btrfs_label_show, btrfs_label_store); | 404 | BTRFS_ATTR_RW(label, btrfs_label_show, btrfs_label_store); |
405 | 405 | ||
406 | static ssize_t btrfs_nodesize_show(struct kobject *kobj, | 406 | static ssize_t btrfs_nodesize_show(struct kobject *kobj, |
407 | struct kobj_attribute *a, char *buf) | 407 | struct kobj_attribute *a, char *buf) |
diff --git a/fs/btrfs/sysfs.h b/fs/btrfs/sysfs.h index 531b11ee9124..f7dd298b3cf6 100644 --- a/fs/btrfs/sysfs.h +++ b/fs/btrfs/sysfs.h | |||
@@ -20,12 +20,13 @@ enum btrfs_feature_set { | |||
20 | .store = _store, \ | 20 | .store = _store, \ |
21 | } | 21 | } |
22 | 22 | ||
23 | #define BTRFS_ATTR_RW(_name, _mode, _show, _store) \ | 23 | #define BTRFS_ATTR_RW(_name, _show, _store) \ |
24 | static struct kobj_attribute btrfs_attr_##_name = \ | 24 | static struct kobj_attribute btrfs_attr_##_name = \ |
25 | __INIT_KOBJ_ATTR(_name, _mode, _show, _store) | 25 | __INIT_KOBJ_ATTR(_name, 0644, _show, _store) |
26 | 26 | ||
27 | #define BTRFS_ATTR(_name, _show) \ | 27 | #define BTRFS_ATTR(_name, _show) \ |
28 | BTRFS_ATTR_RW(_name, 0444, _show, NULL) | 28 | static struct kobj_attribute btrfs_attr_##_name = \ |
29 | __INIT_KOBJ_ATTR(_name, 0444, _show, NULL) | ||
29 | 30 | ||
30 | #define BTRFS_ATTR_PTR(_name) (&btrfs_attr_##_name.attr) | 31 | #define BTRFS_ATTR_PTR(_name) (&btrfs_attr_##_name.attr) |
31 | 32 | ||