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);
59 count = ops->show(kobj, of->kn->priv, buf);
77 static ssize_t sysfs_kf_bin_read(struct kernfs_open_file *of, char *buf,
80 struct bin_attribute *battr = of->kn->priv;
81 struct kobject *kobj = of->kn->parent->priv;
82 loff_t size = file_inode(of->file)->i_size;
97 return battr->read(of->file, kobj, battr, buf, pos, count);
101 static ssize_t sysfs_kf_read(struct kernfs_open_file *of, char *buf,
104 const struct sysfs_ops *ops = sysfs_file_ops(of->kn);
105 struct kobject *kobj = of->kn->parent->priv;
109 * If buf != of->prealloc_buf, we don't know how
112 if (WARN_ON_ONCE(buf != of->prealloc_buf))
114 len = ops->show(kobj, of->kn->priv, buf);
127 static ssize_t sysfs_kf_write(struct kernfs_open_file *of, char *buf,
130 const struct sysfs_ops *ops = sysfs_file_ops(of->kn);
131 struct kobject *kobj = of->kn->parent->priv;
136 return ops->store(kobj, of->kn->priv, buf, count);
140 static ssize_t sysfs_kf_bin_write(struct kernfs_open_file *of, char *buf,
143 struct bin_attribute *battr = of->kn->priv;
144 struct kobject *kobj = of->kn->parent->priv;
145 loff_t size = file_inode(of->file)->i_size;
158 return battr->write(of->file, kobj, battr, buf, pos, count);
161 static int sysfs_kf_bin_mmap(struct kernfs_open_file *of,
164 struct bin_attribute *battr = of->kn->priv;
165 struct kobject *kobj = of->kn->parent->priv;
167 return battr->mmap(of->file, kobj, battr, vma);
170 static int sysfs_kf_bin_open(struct kernfs_open_file *of)
172 struct bin_attribute *battr = of->kn->priv;
175 of->file->f_mapping = battr->f_mapping();
439 * With sysfs, just like kernfs, deletion of an attribute is postponed until
461 * Undo the effects of sysfs_break_active_protection(). Since this function
482 * @ns: namespace tag of the file to remove
597 * sysfs_link_change_owner - change owner of a sysfs file.
598 * @kobj: object of the kernfs_node the symlink is located in.
599 * @targ: object of the kernfs_node the symlink points to.
600 * @name: name of the link.
605 * the ownership to @kuid/@kgid. The symlink is looked up in the namespace of
638 * sysfs_file_change_owner - change owner of a sysfs file.
640 * @name: name of the file to change.
674 * sysfs_change_owner - change owner of the given object.
679 * Change the owner of the default directory, files, groups, and attributes of
682 * sysfs_change_owner() takes care of the default directory entry for @kobj,
683 * the default attributes associated with the ktype of @kobj and the default
684 * attributes associated with the ktype of @kobj.
699 /* Change the owner of the kobject itself. */
707 * Change owner of the default groups associated with the
708 * ktype of @kobj.
721 * sysfs_emit - scnprintf equivalent, aware of PAGE_SIZE buffer.
722 * @buf: start of PAGE_SIZE buffer.
727 * Returns number of characters written to @buf.
747 * sysfs_emit_at - scnprintf equivalent, aware of PAGE_SIZE buffer.
748 * @buf: start of PAGE_SIZE buffer.
755 * Returns number of characters written starting at &@buf[@at].