From 20ee0825ecec889afdf12f7c13b9dc3af0bb9f14 Mon Sep 17 00:00:00 2001 From: Anand Jain Date: Wed, 30 Jul 2014 20:04:09 +0800 Subject: [PATCH] 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 Signed-off-by: Chris Mason --- fs/btrfs/sysfs.c | 2 +- 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 a1c1088..e6a5e7d 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -401,7 +401,7 @@ static ssize_t btrfs_label_store(struct kobject *kobj, return ret; } -BTRFS_ATTR_RW(label, 0644, btrfs_label_show, btrfs_label_store); +BTRFS_ATTR_RW(label, btrfs_label_show, btrfs_label_store); static ssize_t btrfs_nodesize_show(struct kobject *kobj, struct kobj_attribute *a, char *buf) diff --git a/fs/btrfs/sysfs.h b/fs/btrfs/sysfs.h index 531b11e..f7dd298 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) -- 2.7.4