Lines Matching defs:of
42 * Reads on sysfs are handled through seq_file, which takes care of hairy
48 struct kernfs_open_file *of = sf->private;
49 struct kobject *kobj = sysfs_file_kobj(of->kn);
50 const struct sysfs_ops *ops = sysfs_file_ops(of->kn);
65 count = ops->show(kobj, of->kn->priv, buf);
82 static ssize_t sysfs_kf_bin_read(struct kernfs_open_file *of, char *buf,
85 const struct bin_attribute *battr = of->kn->priv;
86 struct kobject *kobj = sysfs_file_kobj(of->kn);
87 loff_t size = file_inode(of->file)->i_size;
102 return battr->read(of->file, kobj, battr, buf, pos, count);
106 static ssize_t sysfs_kf_read(struct kernfs_open_file *of, char *buf,
109 const struct sysfs_ops *ops = sysfs_file_ops(of->kn);
110 struct kobject *kobj = sysfs_file_kobj(of->kn);
114 * If buf != of->prealloc_buf, we don't know how
117 if (WARN_ON_ONCE(buf != of->prealloc_buf))
119 len = ops->show(kobj, of->kn->priv, buf);
136 static ssize_t sysfs_kf_write(struct kernfs_open_file *of, char *buf,
139 const struct sysfs_ops *ops = sysfs_file_ops(of->kn);
140 struct kobject *kobj = sysfs_file_kobj(of->kn);
145 return ops->store(kobj, of->kn->priv, buf, count);
149 static ssize_t sysfs_kf_bin_write(struct kernfs_open_file *of, char *buf,
152 const struct bin_attribute *battr = of->kn->priv;
153 struct kobject *kobj = sysfs_file_kobj(of->kn);
154 loff_t size = file_inode(of->file)->i_size;
167 return battr->write(of->file, kobj, battr, buf, pos, count);
170 static int sysfs_kf_bin_mmap(struct kernfs_open_file *of,
173 const struct bin_attribute *battr = of->kn->priv;
174 struct kobject *kobj = sysfs_file_kobj(of->kn);
176 return battr->mmap(of->file, kobj, battr, vma);
179 static loff_t sysfs_kf_bin_llseek(struct kernfs_open_file *of, loff_t offset,
182 const struct bin_attribute *battr = of->kn->priv;
183 struct kobject *kobj = sysfs_file_kobj(of->kn);
186 return battr->llseek(of->file, kobj, battr, offset, whence);
188 return generic_file_llseek(of->file, offset, whence);
191 static int sysfs_kf_bin_open(struct kernfs_open_file *of)
193 const struct bin_attribute *battr = of->kn->priv;
196 of->file->f_mapping = battr->f_mapping();
461 * With sysfs, just like kernfs, deletion of an attribute is postponed until
485 * Undo the effects of sysfs_break_active_protection(). Since this function
506 * @ns: namespace tag of the file to remove
621 * sysfs_link_change_owner - change owner of a sysfs file.
622 * @kobj: object of the kernfs_node the symlink is located in.
623 * @targ: object of the kernfs_node the symlink points to.
624 * @name: name of the link.
629 * the ownership to @kuid/@kgid. The symlink is looked up in the namespace of
662 * sysfs_file_change_owner - change owner of a sysfs file.
664 * @name: name of the file to change.
697 * sysfs_change_owner - change owner of the given object.
702 * Change the owner of the default directory, files, groups, and attributes of
705 * sysfs_change_owner() takes care of the default directory entry for @kobj,
706 * the default attributes associated with the ktype of @kobj and the default
707 * attributes associated with the ktype of @kobj.
722 /* Change the owner of the kobject itself. */
730 * Change owner of the default groups associated with the
731 * ktype of @kobj.
743 * sysfs_emit - scnprintf equivalent, aware of PAGE_SIZE buffer.
744 * @buf: start of PAGE_SIZE buffer.
749 * Returns number of characters written to @buf.
769 * sysfs_emit_at - scnprintf equivalent, aware of PAGE_SIZE buffer.
770 * @buf: start of PAGE_SIZE buffer.
777 * Returns number of characters written starting at &@buf[@at].
803 * @count: maximum number of bytes to read.
812 * Returns number of bytes written to @buf.