aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAnand Jain <Anand.Jain@oracle.com>2014-07-30 08:04:07 -0400
committerChris Mason <clm@fb.com>2014-09-17 16:37:57 -0400
commit3f4b57e09d6cbd97f92311a801e1b83992506dcd (patch)
tree02fe2d81c35a651061a1802d7687639f7dcd5226 /fs
parent160f4089c8580b32b5805e7fd8ec7b3810f442c1 (diff)
btrfs: use BTRFS_ATTR instead of btrfs_no_store()
we have BTRFS_ATTR define to create sysfs RO file, use that. Signed-off-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/sysfs.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index 82a968fdfd80..e6a851b9ae34 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -403,13 +403,6 @@ static ssize_t btrfs_label_store(struct kobject *kobj,
403} 403}
404BTRFS_ATTR_RW(label, 0644, btrfs_label_show, btrfs_label_store); 404BTRFS_ATTR_RW(label, 0644, btrfs_label_show, btrfs_label_store);
405 405
406static ssize_t btrfs_no_store(struct kobject *kobj,
407 struct kobj_attribute *a,
408 const char *buf, size_t len)
409{
410 return -EPERM;
411}
412
413static ssize_t btrfs_nodesize_show(struct kobject *kobj, 406static ssize_t btrfs_nodesize_show(struct kobject *kobj,
414 struct kobj_attribute *a, char *buf) 407 struct kobj_attribute *a, char *buf)
415{ 408{
@@ -418,7 +411,7 @@ static ssize_t btrfs_nodesize_show(struct kobject *kobj,
418 return snprintf(buf, PAGE_SIZE, "%u\n", fs_info->super_copy->nodesize); 411 return snprintf(buf, PAGE_SIZE, "%u\n", fs_info->super_copy->nodesize);
419} 412}
420 413
421BTRFS_ATTR_RW(nodesize, 0444, btrfs_nodesize_show, btrfs_no_store); 414BTRFS_ATTR(nodesize, 0444, btrfs_nodesize_show);
422 415
423static ssize_t btrfs_sectorsize_show(struct kobject *kobj, 416static ssize_t btrfs_sectorsize_show(struct kobject *kobj,
424 struct kobj_attribute *a, char *buf) 417 struct kobj_attribute *a, char *buf)
@@ -428,7 +421,7 @@ static ssize_t btrfs_sectorsize_show(struct kobject *kobj,
428 return snprintf(buf, PAGE_SIZE, "%u\n", fs_info->super_copy->sectorsize); 421 return snprintf(buf, PAGE_SIZE, "%u\n", fs_info->super_copy->sectorsize);
429} 422}
430 423
431BTRFS_ATTR_RW(sectorsize, 0444, btrfs_sectorsize_show, btrfs_no_store); 424BTRFS_ATTR(sectorsize, 0444, btrfs_sectorsize_show);
432 425
433static ssize_t btrfs_clone_alignment_show(struct kobject *kobj, 426static ssize_t btrfs_clone_alignment_show(struct kobject *kobj,
434 struct kobj_attribute *a, char *buf) 427 struct kobj_attribute *a, char *buf)
@@ -438,7 +431,7 @@ static ssize_t btrfs_clone_alignment_show(struct kobject *kobj,
438 return snprintf(buf, PAGE_SIZE, "%u\n", fs_info->super_copy->sectorsize); 431 return snprintf(buf, PAGE_SIZE, "%u\n", fs_info->super_copy->sectorsize);
439} 432}
440 433
441BTRFS_ATTR_RW(clone_alignment, 0444, btrfs_clone_alignment_show, btrfs_no_store); 434BTRFS_ATTR(clone_alignment, 0444, btrfs_clone_alignment_show);
442 435
443static struct attribute *btrfs_attrs[] = { 436static struct attribute *btrfs_attrs[] = {
444 BTRFS_ATTR_PTR(label), 437 BTRFS_ATTR_PTR(label),