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>
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 @@
.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)