Lines Matching refs:filp
45 static ssize_t nfs_file_splice_read(struct file *filp, loff_t *ppos,
55 static int nfs_lock(struct file *filp, int cmd, struct file_lock *fl);
56 static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl);
118 nfs_file_open(struct inode *inode, struct file *filp) in nfs_file_open() argument
123 filp->f_path.dentry->d_parent->d_name.name, in nfs_file_open()
124 filp->f_path.dentry->d_name.name); in nfs_file_open()
126 res = nfs_check_flags(filp->f_flags); in nfs_file_open()
131 res = nfs_open(inode, filp); in nfs_file_open()
136 nfs_file_release(struct inode *inode, struct file *filp) in nfs_file_release() argument
138 struct dentry *dentry = filp->f_path.dentry; in nfs_file_release()
145 if (filp->f_mode & FMODE_WRITE) in nfs_file_release()
148 return nfs_release(inode, filp); in nfs_file_release()
162 static int nfs_revalidate_file_size(struct inode *inode, struct file *filp) in nfs_revalidate_file_size() argument
169 if (filp->f_flags & O_DIRECT) in nfs_revalidate_file_size()
179 static loff_t nfs_file_llseek(struct file *filp, loff_t offset, int origin) in nfs_file_llseek() argument
184 filp->f_path.dentry->d_parent->d_name.name, in nfs_file_llseek()
185 filp->f_path.dentry->d_name.name, in nfs_file_llseek()
190 struct inode *inode = filp->f_mapping->host; in nfs_file_llseek()
192 int retval = nfs_revalidate_file_size(inode, filp); in nfs_file_llseek()
197 loff = generic_file_llseek_unlocked(filp, offset, origin); in nfs_file_llseek()
200 loff = generic_file_llseek_unlocked(filp, offset, origin); in nfs_file_llseek()
279 nfs_file_splice_read(struct file *filp, loff_t *ppos, in nfs_file_splice_read() argument
283 struct dentry *dentry = filp->f_path.dentry; in nfs_file_splice_read()
291 res = nfs_revalidate_mapping(inode, filp->f_mapping); in nfs_file_splice_read()
293 res = generic_file_splice_read(filp, ppos, pipe, count, flags); in nfs_file_splice_read()
456 struct file *filp = vma->vm_file; in nfs_vm_page_mkwrite() local
457 struct dentry *dentry = filp->f_path.dentry; in nfs_vm_page_mkwrite()
464 filp->f_mapping->host->i_ino, in nfs_vm_page_mkwrite()
477 ret = nfs_flush_incompatible(filp, page); in nfs_vm_page_mkwrite()
481 ret = nfs_updatepage(filp, page, 0, pagelen); in nfs_vm_page_mkwrite()
494 static int nfs_need_sync_write(struct file *filp, struct inode *inode) in nfs_need_sync_write() argument
498 if (IS_SYNC(inode) || (filp->f_flags & O_SYNC)) in nfs_need_sync_write()
500 ctx = nfs_file_open_context(filp); in nfs_need_sync_write()
553 static int do_getlk(struct file *filp, int cmd, struct file_lock *fl) in do_getlk() argument
555 struct inode *inode = filp->f_mapping->host; in do_getlk()
560 posix_test_lock(filp, fl); in do_getlk()
572 status = NFS_PROTO(inode)->lock(filp, cmd, fl); in do_getlk()
601 static int do_unlk(struct file *filp, int cmd, struct file_lock *fl) in do_unlk() argument
603 struct inode *inode = filp->f_mapping->host; in do_unlk()
610 nfs_sync_mapping(filp->f_mapping); in do_unlk()
619 status = NFS_PROTO(inode)->lock(filp, cmd, fl); in do_unlk()
621 status = do_vfs_lock(filp, fl); in do_unlk()
626 static int do_setlk(struct file *filp, int cmd, struct file_lock *fl) in do_setlk() argument
628 struct inode *inode = filp->f_mapping->host; in do_setlk()
635 status = nfs_sync_mapping(filp->f_mapping); in do_setlk()
642 status = NFS_PROTO(inode)->lock(filp, cmd, fl); in do_setlk()
644 status = do_vfs_lock(filp, fl); in do_setlk()
652 nfs_sync_mapping(filp->f_mapping); in do_setlk()
662 static int nfs_lock(struct file *filp, int cmd, struct file_lock *fl) in nfs_lock() argument
664 struct inode *inode = filp->f_mapping->host; in nfs_lock()
668 filp->f_path.dentry->d_parent->d_name.name, in nfs_lock()
669 filp->f_path.dentry->d_name.name, in nfs_lock()
686 ret = do_getlk(filp, cmd, fl); in nfs_lock()
688 ret = do_unlk(filp, cmd, fl); in nfs_lock()
690 ret = do_setlk(filp, cmd, fl); in nfs_lock()
698 static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl) in nfs_flock() argument
701 filp->f_path.dentry->d_parent->d_name.name, in nfs_flock()
702 filp->f_path.dentry->d_name.name, in nfs_flock()
709 fl->fl_owner = (fl_owner_t)filp; in nfs_flock()
714 return do_unlk(filp, cmd, fl); in nfs_flock()
715 return do_setlk(filp, cmd, fl); in nfs_flock()