Lines Matching refs:of
36 * Reads on sysfs are handled through seq_file, which takes care of hairy
42 struct kernfs_open_file *of = sf->private;
43 struct kobject *kobj = of->kn->parent->priv;
44 const struct sysfs_ops *ops = sysfs_file_ops(of->kn);
61 count = ops->show(kobj, of->kn->priv, buf);
80 static ssize_t sysfs_kf_bin_read(struct kernfs_open_file *of, char *buf,
83 struct bin_attribute *battr = of->kn->priv;
84 struct kobject *kobj = of->kn->parent->priv;
85 loff_t size = file_inode(of->file)->i_size;
100 return battr->read(of->file, kobj, battr, buf, pos, count);
104 static ssize_t sysfs_kf_read(struct kernfs_open_file *of, char *buf,
107 const struct sysfs_ops *ops = sysfs_file_ops(of->kn);
108 struct kobject *kobj = of->kn->parent->priv;
112 * If buf != of->prealloc_buf, we don't know how
115 if (WARN_ON_ONCE(buf != of->prealloc_buf))
117 len = ops->show(kobj, of->kn->priv, buf);
130 static ssize_t sysfs_kf_write(struct kernfs_open_file *of, char *buf,
133 const struct sysfs_ops *ops = sysfs_file_ops(of->kn);
134 struct kobject *kobj = of->kn->parent->priv;
139 return ops->store(kobj, of->kn->priv, buf, count);
143 static ssize_t sysfs_kf_bin_write(struct kernfs_open_file *of, char *buf,
146 struct bin_attribute *battr = of->kn->priv;
147 struct kobject *kobj = of->kn->parent->priv;
148 loff_t size = file_inode(of->file)->i_size;
161 return battr->write(of->file, kobj, battr, buf, pos, count);
164 static int sysfs_kf_bin_mmap(struct kernfs_open_file *of,
167 struct bin_attribute *battr = of->kn->priv;
168 struct kobject *kobj = of->kn->parent->priv;
170 return battr->mmap(of->file, kobj, battr, vma);
418 * With sysfs, just like kernfs, deletion of an attribute is postponed until
442 * Undo the effects of sysfs_break_active_protection(). Since this function
463 * @ns: namespace tag of the file to remove
578 * sysfs_link_change_owner - change owner of a sysfs file.
579 * @kobj: object of the kernfs_node the symlink is located in.
580 * @targ: object of the kernfs_node the symlink points to.
581 * @name: name of the link.
586 * the ownership to @kuid/@kgid. The symlink is looked up in the namespace of
619 * sysfs_file_change_owner - change owner of a sysfs file.
621 * @name: name of the file to change.
655 * sysfs_change_owner - change owner of the given object.
660 * Change the owner of the default directory, files, groups, and attributes of
663 * sysfs_change_owner() takes care of the default directory entry for @kobj,
664 * the default attributes associated with the ktype of @kobj and the default
665 * attributes associated with the ktype of @kobj.
680 /* Change the owner of the kobject itself. */
690 * Change owner of the default attributes associated with the
691 * ktype of @kobj.
701 * Change owner of the default groups associated with the
702 * ktype of @kobj.
715 * sysfs_emit - scnprintf equivalent, aware of PAGE_SIZE buffer.
716 * @buf: start of PAGE_SIZE buffer.
721 * Returns number of characters written to @buf.
741 * sysfs_emit_at - scnprintf equivalent, aware of PAGE_SIZE buffer.
742 * @buf: start of PAGE_SIZE buffer.
749 * Returns number of characters written starting at &@buf[@at].