Lines Matching refs:attr
172 void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr) in sysfs_notify() argument
181 if (kn && attr) { in sysfs_notify()
182 tmp = kernfs_find_and_get(kn, attr); in sysfs_notify()
246 const struct attribute *attr, bool is_bin, in sysfs_add_file_mode_ns() argument
284 struct bin_attribute *battr = (void *)attr; in sysfs_add_file_mode_ns()
301 if (!attr->ignore_lockdep) in sysfs_add_file_mode_ns()
302 key = attr->key ?: (struct lock_class_key *)&attr->skey; in sysfs_add_file_mode_ns()
305 kn = __kernfs_create_file(parent, attr->name, mode & 0777, uid, gid, in sysfs_add_file_mode_ns()
306 size, ops, (void *)attr, ns, key); in sysfs_add_file_mode_ns()
309 sysfs_warn_dup(parent, attr->name); in sysfs_add_file_mode_ns()
321 int sysfs_create_file_ns(struct kobject *kobj, const struct attribute *attr, in sysfs_create_file_ns() argument
327 if (WARN_ON(!kobj || !kobj->sd || !attr)) in sysfs_create_file_ns()
331 return sysfs_add_file_mode_ns(kobj->sd, attr, false, attr->mode, in sysfs_create_file_ns()
358 const struct attribute *attr, const char *group) in sysfs_add_file_to_group() argument
376 error = sysfs_add_file_mode_ns(parent, attr, false, in sysfs_add_file_to_group()
377 attr->mode, uid, gid, NULL); in sysfs_add_file_to_group()
391 int sysfs_chmod_file(struct kobject *kobj, const struct attribute *attr, in sysfs_chmod_file() argument
398 kn = kernfs_find_and_get(kobj->sd, attr->name); in sysfs_chmod_file()
423 const struct attribute *attr) in sysfs_break_active_protection() argument
428 kn = kernfs_find_and_get(kobj->sd, attr->name); in sysfs_break_active_protection()
464 void sysfs_remove_file_ns(struct kobject *kobj, const struct attribute *attr, in sysfs_remove_file_ns() argument
469 kernfs_remove_by_name_ns(parent, attr->name, ns); in sysfs_remove_file_ns()
480 bool sysfs_remove_file_self(struct kobject *kobj, const struct attribute *attr) in sysfs_remove_file_self() argument
486 kn = kernfs_find_and_get(parent, attr->name); in sysfs_remove_file_self()
512 const struct attribute *attr, const char *group) in sysfs_remove_file_from_group() argument
524 kernfs_remove_by_name(parent, attr->name); in sysfs_remove_file_from_group()
536 const struct bin_attribute *attr) in sysfs_create_bin_file() argument
541 if (WARN_ON(!kobj || !kobj->sd || !attr)) in sysfs_create_bin_file()
545 return sysfs_add_file_mode_ns(kobj->sd, &attr->attr, true, in sysfs_create_bin_file()
546 attr->attr.mode, uid, gid, NULL); in sysfs_create_bin_file()
556 const struct bin_attribute *attr) in sysfs_remove_bin_file() argument
558 kernfs_remove_by_name(kobj->sd, attr->attr.name); in sysfs_remove_bin_file()