Lines Matching defs:file

5  * file.c - operations for regular (text) files.
51 static inline struct configfs_fragment *to_frag(struct file *file)
53 struct configfs_dirent *sd = file->f_path.dentry->d_fsdata;
58 static int fill_read_buffer(struct file *file, struct configfs_buffer *buffer)
60 struct configfs_fragment *frag = to_frag(file);
84 * @file: file pointer.
87 * @ppos: starting offset in file.
89 * Userspace wants to read an attribute file. The attribute descriptor
90 * is in the file's ->d_fsdata. The target item is in the directory's
95 * the beginning of the file). That should fill the entire buffer with
102 configfs_read_file(struct file *file, char __user *buf, size_t count, loff_t *ppos)
104 struct configfs_buffer *buffer = file->private_data;
109 retval = fill_read_buffer(file, buffer);
124 * @file: file pointer.
127 * @ppos: starting offset in file.
129 * Userspace wants to read a binary attribute file. The attribute
130 * descriptor is in the file's ->d_fsdata. The target item is in the
143 configfs_read_bin_file(struct file *file, char __user *buf,
146 struct configfs_fragment *frag = to_frag(file);
147 struct configfs_buffer *buffer = file->private_data;
215 * @buffer: data buffer for file.
244 flush_write_buffer(struct file *file, struct configfs_buffer *buffer, size_t count)
246 struct configfs_fragment *frag = to_frag(file);
259 * @file: file pointer
270 * Hint: if you're writing a value, first read the file, modify only
275 configfs_write_file(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
277 struct configfs_buffer *buffer = file->private_data;
283 len = flush_write_buffer(file, buffer, len);
292 * @file: file pointer
297 * Writing to a binary attribute file is similar to a normal read.
300 * commit until the close of the file.
304 configfs_write_bin_file(struct file *file, const char __user *buf,
307 struct configfs_buffer *buffer = file->private_data;
356 static int __configfs_open_file(struct inode *inode, struct file *file, int type)
358 struct dentry *dentry = file->f_path.dentry;
359 struct configfs_fragment *frag = to_frag(file);
406 if (file->f_mode & FMODE_WRITE) {
419 if (file->f_mode & FMODE_READ) {
432 file->private_data = buffer;
445 static int configfs_release(struct inode *inode, struct file *filp)
457 static int configfs_open_file(struct inode *inode, struct file *filp)
462 static int configfs_open_bin_file(struct inode *inode, struct file *filp)
467 static int configfs_release_bin_file(struct inode *inode, struct file *file)
469 struct configfs_buffer *buffer = file->private_data;
474 struct configfs_fragment *frag = to_frag(file);
492 configfs_release(inode, file);
508 .llseek = NULL, /* bin file is not seekable */
514 * configfs_create_file - create an attribute file for an item.
535 * configfs_create_bin_file - create a binary attribute file for an item.