Lines Matching refs:grp
21 const struct attribute_group *grp) in remove_files() argument
26 if (grp->attrs) in remove_files()
27 for (attr = grp->attrs; *attr; attr++) in remove_files()
29 if (grp->bin_attrs) in remove_files()
30 for (bin_attr = grp->bin_attrs; *bin_attr; bin_attr++) in remove_files()
34 static umode_t __first_visible(const struct attribute_group *grp, struct kobject *kobj) in __first_visible() argument
36 if (grp->attrs && grp->attrs[0] && grp->is_visible) in __first_visible()
37 return grp->is_visible(kobj, grp->attrs[0], 0); in __first_visible()
39 if (grp->bin_attrs && grp->bin_attrs[0] && grp->is_bin_visible) in __first_visible()
40 return grp->is_bin_visible(kobj, grp->bin_attrs[0], 0); in __first_visible()
47 const struct attribute_group *grp, int update) in create_files() argument
53 if (grp->attrs) { in create_files()
54 for (i = 0, attr = grp->attrs; *attr && !error; i++, attr++) { in create_files()
64 if (grp->is_visible) { in create_files()
65 mode = grp->is_visible(kobj, *attr, i); in create_files()
82 remove_files(parent, grp); in create_files()
87 if (grp->bin_attrs) { in create_files()
88 for (i = 0, bin_attr = grp->bin_attrs; *bin_attr; i++, bin_attr++) { in create_files()
94 if (grp->is_bin_visible) { in create_files()
95 mode = grp->is_bin_visible(kobj, *bin_attr, i); in create_files()
113 remove_files(parent, grp); in create_files()
121 const struct attribute_group *grp) in internal_create_group() argument
135 if (!grp->attrs && !grp->bin_attrs) { in internal_create_group()
137 kobj->name, grp->name ?: ""); in internal_create_group()
142 if (grp->name) { in internal_create_group()
143 umode_t mode = __first_visible(grp, kobj); in internal_create_group()
151 kn = kernfs_find_and_get(kobj->sd, grp->name); in internal_create_group()
154 kobj->name, grp->name); in internal_create_group()
158 sysfs_remove_group(kobj, grp); in internal_create_group()
167 kn = kernfs_create_dir_ns(kobj->sd, grp->name, mode, in internal_create_group()
171 sysfs_warn_dup(kobj->sd, grp->name); in internal_create_group()
180 error = create_files(kn, kobj, uid, gid, grp, update); in internal_create_group()
182 if (grp->name) in internal_create_group()
187 if (grp->name && update) in internal_create_group()
204 const struct attribute_group *grp) in sysfs_create_group() argument
206 return internal_create_group(kobj, 0, grp); in sysfs_create_group()
287 const struct attribute_group *grp) in sysfs_update_group() argument
289 return internal_create_group(kobj, 1, grp); in sysfs_update_group()
302 const struct attribute_group *grp) in sysfs_remove_group() argument
307 if (grp->name) { in sysfs_remove_group()
308 kn = kernfs_find_and_get(parent, grp->name); in sysfs_remove_group()
311 grp->name, kobject_name(kobj)); in sysfs_remove_group()
319 remove_files(kn, grp); in sysfs_remove_group()
320 if (grp->name) in sysfs_remove_group()
357 const struct attribute_group *grp) in sysfs_merge_group() argument
366 parent = kernfs_find_and_get(kobj->sd, grp->name); in sysfs_merge_group()
372 for ((i = 0, attr = grp->attrs); *attr && !error; (++i, ++attr)) in sysfs_merge_group()
391 const struct attribute_group *grp) in sysfs_unmerge_group() argument
396 parent = kernfs_find_and_get(kobj->sd, grp->name); in sysfs_unmerge_group()
398 for (attr = grp->attrs; *attr; ++attr) in sysfs_unmerge_group()
499 const struct attribute_group *grp, in sysfs_group_attrs_change_owner() argument
505 if (grp->attrs) { in sysfs_group_attrs_change_owner()
508 for (attr = grp->attrs; *attr; attr++) { in sysfs_group_attrs_change_owner()
520 if (grp->bin_attrs) { in sysfs_group_attrs_change_owner()
523 for (bin_attr = grp->bin_attrs; *bin_attr; bin_attr++) { in sysfs_group_attrs_change_owner()
548 const struct attribute_group *grp, kuid_t kuid, in sysfs_group_change_owner() argument
562 if (grp->name) { in sysfs_group_change_owner()
563 grp_kn = kernfs_find_and_get(kobj->sd, grp->name); in sysfs_group_change_owner()
573 error = sysfs_group_attrs_change_owner(grp_kn, grp, &newattrs); in sysfs_group_change_owner()