summaryrefslogtreecommitdiffstats
path: root/fs/sysfs/group.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-09-13 07:41:12 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-09-14 16:59:46 +0200
commit5cf3bb0d3a2d0de94f3f551f0e4211068818aabf (patch)
tree91065bdd7f4c5e74a1da37bf8b67f76190271c72 /fs/sysfs/group.c
parentkernfs: remove the unused lockdep_key field in struct kernfs_ops (diff)
downloadlinux-5cf3bb0d3a2d0de94f3f551f0e4211068818aabf.tar.xz
linux-5cf3bb0d3a2d0de94f3f551f0e4211068818aabf.zip
sysfs: split out binary attribute handling from sysfs_add_file_mode_ns
Split adding binary attributes into a separate handler instead of overloading sysfs_add_file_mode_ns. Acked-by: Christian Brauner <christian.brauner@ubuntu.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20210913054121.616001-5-hch@lst.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/sysfs/group.c')
-rw-r--r--fs/sysfs/group.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/fs/sysfs/group.c b/fs/sysfs/group.c
index f29d62004527..eeb0e3099421 100644
--- a/fs/sysfs/group.c
+++ b/fs/sysfs/group.c
@@ -61,8 +61,8 @@ static int create_files(struct kernfs_node *parent, struct kobject *kobj,
(*attr)->name, mode);
mode &= SYSFS_PREALLOC | 0664;
- error = sysfs_add_file_mode_ns(parent, *attr, false,
- mode, uid, gid, NULL);
+ error = sysfs_add_file_mode_ns(parent, *attr, mode, uid,
+ gid, NULL);
if (unlikely(error))
break;
}
@@ -90,10 +90,9 @@ static int create_files(struct kernfs_node *parent, struct kobject *kobj,
(*bin_attr)->attr.name, mode);
mode &= SYSFS_PREALLOC | 0664;
- error = sysfs_add_file_mode_ns(parent,
- &(*bin_attr)->attr, true,
- mode,
- uid, gid, NULL);
+ error = sysfs_add_bin_file_mode_ns(parent, *bin_attr,
+ mode, uid, gid,
+ NULL);
if (error)
break;
}
@@ -340,8 +339,8 @@ int sysfs_merge_group(struct kobject *kobj,
kobject_get_ownership(kobj, &uid, &gid);
for ((i = 0, attr = grp->attrs); *attr && !error; (++i, ++attr))
- error = sysfs_add_file_mode_ns(parent, *attr, false,
- (*attr)->mode, uid, gid, NULL);
+ error = sysfs_add_file_mode_ns(parent, *attr, (*attr)->mode,
+ uid, gid, NULL);
if (error) {
while (--i >= 0)
kernfs_remove_by_name(parent, (*--attr)->name);