diff options
author | Anand Jain <Anand.Jain@oracle.com> | 2014-07-30 20:04:09 +0800 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-09-17 13:37:59 -0700 |
commit | 20ee0825ecec889afdf12f7c13b9dc3af0bb9f14 (patch) | |
tree | bad80d3fef77e61371739a629662a763c7bf0f2b /fs/btrfs/sysfs.h | |
parent | 98b3d389eb473f28ef69547c0a9f72041c4c40e6 (diff) | |
download | linux-stable-20ee0825ecec889afdf12f7c13b9dc3af0bb9f14.tar.gz linux-stable-20ee0825ecec889afdf12f7c13b9dc3af0bb9f14.tar.bz2 linux-stable-20ee0825ecec889afdf12f7c13b9dc3af0bb9f14.zip |
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/sysfs.h')
-rw-r--r-- | fs/btrfs/sysfs.h | 7 |
1 files changed, 4 insertions, 3 deletions
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 { .store = _store, \ } -#define BTRFS_ATTR_RW(_name, _mode, _show, _store) \ +#define BTRFS_ATTR_RW(_name, _show, _store) \ static struct kobj_attribute btrfs_attr_##_name = \ - __INIT_KOBJ_ATTR(_name, _mode, _show, _store) + __INIT_KOBJ_ATTR(_name, 0644, _show, _store) #define BTRFS_ATTR(_name, _show) \ - BTRFS_ATTR_RW(_name, 0444, _show, NULL) + static struct kobj_attribute btrfs_attr_##_name = \ + __INIT_KOBJ_ATTR(_name, 0444, _show, NULL) #define BTRFS_ATTR_PTR(_name) (&btrfs_attr_##_name.attr) |