提交 20ee0825 编写于 作者: A Anand Jain 提交者: Chris Mason

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: NAnand Jain <anand.jain@oracle.com>
Signed-off-by: NChris Mason <clm@fb.com>
上级 98b3d389
......@@ -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)
......
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册