Lines Matching refs:file

3  * fs/kernfs/file.c - kernfs file implementation
22 * There's one kernfs_open_file for each open file and one kernfs_open_node
55 static struct kernfs_open_file *kernfs_of(struct file *file)
57 return ((struct seq_file *)file->private_data)->private;
110 * the ops aren't called concurrently for the same open file.
179 * As reading a bin file can have side-effects, the exact offset and bytes
201 * the ops aren't called concurrently for the same open file.
251 * the first write. Hint: if you're writing a value, first read the file,
285 * the ops aren't called concurrently for the same open file.
316 struct file *file = vma->vm_file;
317 struct kernfs_open_file *of = kernfs_of(file);
333 struct file *file = vmf->vma->vm_file;
334 struct kernfs_open_file *of = kernfs_of(file);
353 struct file *file = vmf->vma->vm_file;
354 struct kernfs_open_file *of = kernfs_of(file);
367 file_update_time(file);
376 struct file *file = vma->vm_file;
377 struct kernfs_open_file *of = kernfs_of(file);
398 struct file *file = vma->vm_file;
399 struct kernfs_open_file *of = kernfs_of(file);
419 struct file *file = vma->vm_file;
420 struct kernfs_open_file *of = kernfs_of(file);
450 static int kernfs_fop_mmap(struct file *file, struct vm_area_struct *vma)
452 struct kernfs_open_file *of = kernfs_of(file);
482 if (vma->vm_file != file)
597 static int kernfs_fop_open(struct inode *inode, struct file *file)
617 if ((file->f_mode & FMODE_WRITE) &&
621 if ((file->f_mode & FMODE_READ) &&
626 /* allocate a kernfs_open_file for the file */
639 * open file has a separate mutex, it's okay as long as those don't
640 * happen on the same file. At this point, we can't easily give
641 * each file a separate locking class. Let's differentiate on
642 * whether the file has mmap or not for now.
653 of->file = file;
684 error = seq_open(file, &kernfs_seq_ops);
686 error = seq_open(file, NULL);
690 of->seq_file = file->private_data;
694 if (file->f_mode & FMODE_WRITE)
695 file->f_mode |= FMODE_PWRITE;
716 seq_release(inode, file);
730 * @of is guaranteed to have no other file operations in flight and
740 * A file is never detached without being released and we
749 static int kernfs_fop_release(struct inode *inode, struct file *filp)
787 struct inode *inode = file_inode(of->file);
809 * need to close and re-open the file, or seek to 0 and read again.
817 struct kernfs_node *kn = kernfs_dentry_node(of->file->f_path.dentry);
820 poll_wait(of->file, &on->poll, wait);
828 static __poll_t kernfs_fop_poll(struct file *filp, poll_table *wait)
874 * have the matching @file available. Look up the inodes
907 * kernfs_notify - notify a kernfs file
908 * @kn: file to notify
957 * __kernfs_create_file - kernfs internal function to create a file
958 * @parent: directory to create the file in
959 * @name: name of the file
960 * @mode: mode of the file
961 * @uid: uid of the file
962 * @gid: gid of the file
963 * @size: size of the file
964 * @ops: kernfs operations for the file
965 * @priv: private data for the file
966 * @ns: optional namespace tag of the file
967 * @key: lockdep key for the file's active_ref, %NULL to disable lockdep