Lines Matching refs:attr

165 void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr)  in sysfs_notify()  argument
174 if (kn && attr) { in sysfs_notify()
175 tmp = kernfs_find_and_get(kn, attr); in sysfs_notify()
239 const struct attribute *attr, bool is_bin, in sysfs_add_file_mode_ns() argument
277 struct bin_attribute *battr = (void *)attr; in sysfs_add_file_mode_ns()
294 if (!attr->ignore_lockdep) in sysfs_add_file_mode_ns()
295 key = attr->key ?: (struct lock_class_key *)&attr->skey; in sysfs_add_file_mode_ns()
297 kn = __kernfs_create_file(parent, attr->name, mode & 0777, size, ops, in sysfs_add_file_mode_ns()
298 (void *)attr, ns, key); in sysfs_add_file_mode_ns()
301 sysfs_warn_dup(parent, attr->name); in sysfs_add_file_mode_ns()
307 int sysfs_add_file(struct kernfs_node *parent, const struct attribute *attr, in sysfs_add_file() argument
310 return sysfs_add_file_mode_ns(parent, attr, is_bin, attr->mode, NULL); in sysfs_add_file()
319 int sysfs_create_file_ns(struct kobject *kobj, const struct attribute *attr, in sysfs_create_file_ns() argument
322 BUG_ON(!kobj || !kobj->sd || !attr); in sysfs_create_file_ns()
324 return sysfs_add_file_mode_ns(kobj->sd, attr, false, attr->mode, ns); in sysfs_create_file_ns()
350 const struct attribute *attr, const char *group) in sysfs_add_file_to_group() argument
365 error = sysfs_add_file(parent, attr, false); in sysfs_add_file_to_group()
379 int sysfs_chmod_file(struct kobject *kobj, const struct attribute *attr, in sysfs_chmod_file() argument
386 kn = kernfs_find_and_get(kobj->sd, attr->name); in sysfs_chmod_file()
408 void sysfs_remove_file_ns(struct kobject *kobj, const struct attribute *attr, in sysfs_remove_file_ns() argument
413 kernfs_remove_by_name_ns(parent, attr->name, ns); in sysfs_remove_file_ns()
424 bool sysfs_remove_file_self(struct kobject *kobj, const struct attribute *attr) in sysfs_remove_file_self() argument
430 kn = kernfs_find_and_get(parent, attr->name); in sysfs_remove_file_self()
455 const struct attribute *attr, const char *group) in sysfs_remove_file_from_group() argument
467 kernfs_remove_by_name(parent, attr->name); in sysfs_remove_file_from_group()
479 const struct bin_attribute *attr) in sysfs_create_bin_file() argument
481 BUG_ON(!kobj || !kobj->sd || !attr); in sysfs_create_bin_file()
483 return sysfs_add_file(kobj->sd, &attr->attr, true); in sysfs_create_bin_file()
493 const struct bin_attribute *attr) in sysfs_remove_bin_file() argument
495 kernfs_remove_by_name(kobj->sd, attr->attr.name); in sysfs_remove_bin_file()