Lines Matching refs:kobj

34 static int create_files(struct kernfs_node *parent, struct kobject *kobj,  in create_files()  argument
54 mode = grp->is_visible(kobj, *attr, i); in create_files()
83 mode = grp->is_bin_visible(kobj, *bin_attr, i); in create_files()
107 static int internal_create_group(struct kobject *kobj, int update, in internal_create_group() argument
115 if (WARN_ON(!kobj || (!update && !kobj->sd))) in internal_create_group()
119 if (unlikely(update && !kobj->sd)) in internal_create_group()
124 kobj->name, grp->name ?: ""); in internal_create_group()
128 kobject_get_ownership(kobj, &uid, &gid); in internal_create_group()
131 kn = kernfs_find_and_get(kobj->sd, grp->name); in internal_create_group()
134 kobj->name, grp->name); in internal_create_group()
138 kn = kernfs_create_dir_ns(kobj->sd, grp->name, in internal_create_group()
140 uid, gid, kobj, NULL); in internal_create_group()
143 sysfs_warn_dup(kobj->sd, grp->name); in internal_create_group()
148 kn = kobj->sd; in internal_create_group()
152 error = create_files(kn, kobj, uid, gid, grp, update); in internal_create_group()
175 int sysfs_create_group(struct kobject *kobj, in sysfs_create_group() argument
178 return internal_create_group(kobj, 0, grp); in sysfs_create_group()
182 static int internal_create_groups(struct kobject *kobj, int update, in internal_create_groups() argument
192 error = internal_create_group(kobj, update, groups[i]); in internal_create_groups()
195 sysfs_remove_group(kobj, groups[i]); in internal_create_groups()
215 int sysfs_create_groups(struct kobject *kobj, in sysfs_create_groups() argument
218 return internal_create_groups(kobj, 0, groups); in sysfs_create_groups()
233 int sysfs_update_groups(struct kobject *kobj, in sysfs_update_groups() argument
236 return internal_create_groups(kobj, 1, groups); in sysfs_update_groups()
258 int sysfs_update_group(struct kobject *kobj, in sysfs_update_group() argument
261 return internal_create_group(kobj, 1, grp); in sysfs_update_group()
273 void sysfs_remove_group(struct kobject *kobj, in sysfs_remove_group() argument
276 struct kernfs_node *parent = kobj->sd; in sysfs_remove_group()
284 grp->name, kobject_name(kobj)); in sysfs_remove_group()
308 void sysfs_remove_groups(struct kobject *kobj, in sysfs_remove_groups() argument
316 sysfs_remove_group(kobj, groups[i]); in sysfs_remove_groups()
329 int sysfs_merge_group(struct kobject *kobj, in sysfs_merge_group() argument
339 parent = kernfs_find_and_get(kobj->sd, grp->name); in sysfs_merge_group()
343 kobject_get_ownership(kobj, &uid, &gid); in sysfs_merge_group()
363 void sysfs_unmerge_group(struct kobject *kobj, in sysfs_unmerge_group() argument
369 parent = kernfs_find_and_get(kobj->sd, grp->name); in sysfs_unmerge_group()
385 int sysfs_add_link_to_group(struct kobject *kobj, const char *group_name, in sysfs_add_link_to_group() argument
391 parent = kernfs_find_and_get(kobj->sd, group_name); in sysfs_add_link_to_group()
408 void sysfs_remove_link_from_group(struct kobject *kobj, const char *group_name, in sysfs_remove_link_from_group() argument
413 parent = kernfs_find_and_get(kobj->sd, group_name); in sysfs_remove_link_from_group()
430 int compat_only_sysfs_link_entry_to_kobj(struct kobject *kobj, in compat_only_sysfs_link_entry_to_kobj() argument
461 link = kernfs_create_link(kobj->sd, symlink_name, entry); in compat_only_sysfs_link_entry_to_kobj()
463 sysfs_warn_dup(kobj->sd, symlink_name); in compat_only_sysfs_link_entry_to_kobj()
520 int sysfs_group_change_owner(struct kobject *kobj, in sysfs_group_change_owner() argument
532 if (!kobj->state_in_sysfs) in sysfs_group_change_owner()
536 grp_kn = kernfs_find_and_get(kobj->sd, grp->name); in sysfs_group_change_owner()
538 kernfs_get(kobj->sd); in sysfs_group_change_owner()
539 grp_kn = kobj->sd; in sysfs_group_change_owner()
563 int sysfs_groups_change_owner(struct kobject *kobj, in sysfs_groups_change_owner() argument
569 if (!kobj->state_in_sysfs) in sysfs_groups_change_owner()
576 error = sysfs_group_change_owner(kobj, groups[i], kuid, kgid); in sysfs_groups_change_owner()