Lines Matching refs:file

3  *  linux/fs/nfs/file.c
13 * Expire cache on write to a file by Wai S Kok (Oct 1994).
17 * nfs regular file handling functions
58 * Open file
61 nfs_file_open(struct inode *inode, struct file *filp)
65 dprintk("NFS: open file(%pD2)\n", filp);
79 nfs_file_release(struct inode *inode, struct file *filp)
91 * nfs_revalidate_file_size - Revalidate the file size
93 * @filp: pointer to struct file
95 * Revalidates the file length. This is basically a wrapper around
98 * idea of what the file length is), or O_DIRECT (in which case we
101 static int nfs_revalidate_file_size(struct inode *inode, struct file *filp)
114 loff_t nfs_file_llseek(struct file *filp, loff_t offset, int whence)
116 dprintk("NFS: llseek file(%pD2, %lld, %d)\n",
121 * the cached file length
139 nfs_file_flush(struct file *file, fl_owner_t id)
141 struct inode *inode = file_inode(file);
144 dprintk("NFS: flush(%pD2)\n", file);
147 if ((file->f_mode & FMODE_WRITE) == 0)
151 since = filemap_sample_wb_err(file->f_mapping);
153 return filemap_check_wb_err(file->f_mapping, since);
182 nfs_file_splice_read(struct file *in, loff_t *ppos, struct pipe_inode_info *pipe,
203 nfs_file_mmap(struct file *file, struct vm_area_struct *vma)
205 struct inode *inode = file_inode(file);
208 dprintk("NFS: mmap(%pD2)\n", file);
213 status = generic_file_mmap(file, vma);
216 status = nfs_revalidate_mapping(inode, file->f_mapping);
228 nfs_file_fsync_commit(struct file *file, int datasync)
230 struct inode *inode = file_inode(file);
233 dprintk("NFS: fsync file(%pD2) datasync %d\n", file, datasync);
237 ret2 = file_check_and_advance_wb_err(file);
244 nfs_file_fsync(struct file *file, loff_t start, loff_t end, int datasync)
246 struct inode *inode = file_inode(file);
255 ret = file_write_and_wait_range(file, start, end);
258 ret = nfs_file_fsync_commit(file, datasync);
293 * It may be more efficient to read the page first if the file is
297 * that there were valid bytes of data in that range of the file,
299 * that range of the file.
311 static bool nfs_want_read_modify_write(struct file *file, struct folio *folio,
322 if (pnfs_ld_read_whole_page(file_inode(file)))
325 if (file->f_mode & FMODE_READ)
338 static int nfs_write_begin(struct file *file, struct address_space *mapping,
347 file, mapping->host->i_ino, len, (long long) pos);
356 ret = nfs_flush_incompatible(file, folio);
361 nfs_want_read_modify_write(file, folio, pos, len)) {
363 ret = nfs_read_folio(file, folio);
371 static int nfs_write_end(struct file *file, struct address_space *mapping,
375 struct nfs_open_context *ctx = nfs_file_open_context(file);
381 file, mapping->host->i_ino, len, (long long) pos);
385 * as up to date if it turns out that we're extending the file.
403 status = nfs_update_folio(file, folio, offset, copied);
509 static int nfs_swap_activate(struct swap_info_struct *sis, struct file *file,
515 struct inode *inode = file_inode(file);
546 static void nfs_swap_deactivate(struct file *file)
548 struct inode *inode = file_inode(file);
554 cl->rpc_ops->disable_swap(file_inode(file));
582 struct file *filp = vmf->vma->vm_file;
638 struct file *file = iocb->ki_filp;
639 struct inode *inode = file_inode(file);
645 result = nfs_key_timeout_notify(file, inode);
653 file, iov_iter_count(from), (long long) iocb->ki_pos);
658 * O_APPEND implies that we must revalidate the file length.
661 result = nfs_revalidate_file_size(inode, file);
666 nfs_clear_invalid_mapping(file->f_mapping);
668 since = filemap_sample_wb_err(file->f_mapping);
681 result = filemap_fdatawrite_range(file->f_mapping,
688 filemap_fdatawait_range(file->f_mapping,
698 error = filemap_check_wb_err(file->f_mapping, since);
706 error = file_check_and_advance_wb_err(file);
713 printk(KERN_INFO "NFS: attempt to write to active swap file!\n");
719 do_getlk(struct file *filp, int cmd, struct file_lock *fl, int is_local)
748 do_unlk(struct file *filp, int cmd, struct file_lock *fl, int is_local)
784 do_setlk(struct file *filp, int cmd, struct file_lock *fl, int is_local)
810 * the file is mapped, clear the page cache as well so
826 * Lock a (portion of) a file
828 int nfs_lock(struct file *filp, int cmd, struct file_lock *fl)
864 * Lock a (portion of) a file
866 int nfs_flock(struct file *filp, int cmd, struct file_lock *fl)