Lines Matching refs:kobj

27 	struct kobject *kobj = kn->parent->priv;  in sysfs_file_ops()  local
31 return kobj->ktype ? kobj->ktype->sysfs_ops : NULL; in sysfs_file_ops()
42 struct kobject *kobj = of->kn->parent->priv; in sysfs_kf_seq_show() local
60 count = ops->show(kobj, of->kn->priv, buf); in sysfs_kf_seq_show()
83 struct kobject *kobj = of->kn->parent->priv; in sysfs_kf_bin_read() local
99 return battr->read(of->file, kobj, battr, buf, pos, count); in sysfs_kf_bin_read()
107 struct kobject *kobj = of->kn->parent->priv; in sysfs_kf_read() local
116 len = ops->show(kobj, of->kn->priv, buf); in sysfs_kf_read()
133 struct kobject *kobj = of->kn->parent->priv; in sysfs_kf_write() local
138 return ops->store(kobj, of->kn->priv, buf, count); in sysfs_kf_write()
146 struct kobject *kobj = of->kn->parent->priv; in sysfs_kf_bin_write() local
160 return battr->write(of->file, kobj, battr, buf, pos, count); in sysfs_kf_bin_write()
167 struct kobject *kobj = of->kn->parent->priv; in sysfs_kf_bin_mmap() local
169 return battr->mmap(of->file, kobj, battr, vma); in sysfs_kf_bin_mmap()
172 void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr) in sysfs_notify() argument
174 struct kernfs_node *kn = kobj->sd, *tmp; in sysfs_notify()
255 struct kobject *kobj = parent->priv; in sysfs_add_file_mode_ns() local
256 const struct sysfs_ops *sysfs_ops = kobj->ktype->sysfs_ops; in sysfs_add_file_mode_ns()
261 kobject_name(kobj))) 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()
330 kobject_get_ownership(kobj, &uid, &gid); in sysfs_create_file_ns()
331 return sysfs_add_file_mode_ns(kobj->sd, attr, false, attr->mode, in sysfs_create_file_ns()
337 int sysfs_create_files(struct kobject *kobj, const struct attribute * const *ptr) in sysfs_create_files() argument
343 err = sysfs_create_file(kobj, ptr[i]); in sysfs_create_files()
346 sysfs_remove_file(kobj, ptr[i]); in sysfs_create_files()
357 int sysfs_add_file_to_group(struct kobject *kobj, in sysfs_add_file_to_group() argument
366 parent = kernfs_find_and_get(kobj->sd, group); in sysfs_add_file_to_group()
368 parent = kobj->sd; in sysfs_add_file_to_group()
375 kobject_get_ownership(kobj, &uid, &gid); 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()
422 struct kernfs_node *sysfs_break_active_protection(struct kobject *kobj, in sysfs_break_active_protection() argument
427 kobject_get(kobj); in sysfs_break_active_protection()
428 kn = kernfs_find_and_get(kobj->sd, attr->name); in sysfs_break_active_protection()
448 struct kobject *kobj = kn->parent->priv; in sysfs_unbreak_active_protection() local
452 kobject_put(kobj); in sysfs_unbreak_active_protection()
464 void sysfs_remove_file_ns(struct kobject *kobj, const struct attribute *attr, in sysfs_remove_file_ns() argument
467 struct kernfs_node *parent = kobj->sd; in sysfs_remove_file_ns()
480 bool sysfs_remove_file_self(struct kobject *kobj, const struct attribute *attr) in sysfs_remove_file_self() argument
482 struct kernfs_node *parent = kobj->sd; in sysfs_remove_file_self()
496 void sysfs_remove_files(struct kobject *kobj, const struct attribute * const *ptr) in sysfs_remove_files() argument
501 sysfs_remove_file(kobj, ptr[i]); in sysfs_remove_files()
511 void sysfs_remove_file_from_group(struct kobject *kobj, in sysfs_remove_file_from_group() argument
517 parent = kernfs_find_and_get(kobj->sd, group); in sysfs_remove_file_from_group()
519 parent = kobj->sd; in sysfs_remove_file_from_group()
535 int sysfs_create_bin_file(struct kobject *kobj, in sysfs_create_bin_file() argument
541 if (WARN_ON(!kobj || !kobj->sd || !attr)) in sysfs_create_bin_file()
544 kobject_get_ownership(kobj, &uid, &gid); in sysfs_create_bin_file()
545 return sysfs_add_file_mode_ns(kobj->sd, &attr->attr, true, in sysfs_create_bin_file()
555 void sysfs_remove_bin_file(struct kobject *kobj, in sysfs_remove_bin_file() argument
558 kernfs_remove_by_name(kobj->sd, attr->attr.name); in sysfs_remove_bin_file()