Lines Matching defs:file

173  * to make a read of a certain size at a point in the file.  We are permitted
240 static int cifs_init_request(struct netfs_io_request *rreq, struct file *file)
249 if (file) {
250 open_file = file->private_data;
251 rreq->netfs_priv = file->private_data;
434 cifs_dbg(FYI, "Application %s pid %d has incorrectly set O_EXCL flag but not O_CREAT on file open. Ignoring O_EXCL\n",
564 * FILE_SUPERSEDE (ie create whether or not file exists although
566 * file rather than creating a new file as FILE_SUPERSEDE does
578 /* BB pass O_SYNC flag through on file attributes .. BB */
654 struct cifsFileInfo *cifs_new_fileinfo(struct cifs_fid *fid, struct file *file,
658 struct dentry *dentry = file_dentry(file);
693 cfile->f_flags = file->f_flags;
730 /* if readable file instance put first in list*/
732 if (file->f_mode & FMODE_READ)
742 file->private_data = cfile;
763 * Delete any outstanding lock records. We'll lose them when the file
826 * cifsFileInfo_put - release a reference of file priv data
830 * @cifs_file: cifs/smb3 specific info (eg refcounts) for an open file
838 * _cifsFileInfo_put - release a reference of file priv data
845 * reference, wait for any running oplock break handler of the file
848 * @cifs_file: cifs/smb3 specific info (eg refcounts) for an open file
896 * close because it may cause a error when we open this file
945 int cifs_open(struct inode *inode, struct file *file)
980 full_path = build_path_from_dentry(file_dentry(file), page);
986 cifs_dbg(FYI, "inode = 0x%p file flags are 0x%x for %s\n",
987 inode, file->f_flags, full_path);
989 if (file->f_flags & O_DIRECT &&
992 file->f_op = &cifs_file_direct_nobrl_ops;
994 file->f_op = &cifs_file_direct_ops;
1000 if (file->f_flags == cfile->f_flags) {
1001 file->private_data = cfile;
1023 file->f_flags, &oplock, &fid.netfid, xid);
1052 rc = cifs_nt_open(full_path, inode, cifs_sb, tcon, file->f_flags, &oplock, &fid,
1060 cfile = cifs_new_fileinfo(&fid, file, tlink, oplock, data.symlink_target);
1090 fscache_use_cookie(cifs_inode_cookie(file_inode(file)),
1091 file->f_mode & FMODE_WRITE);
1092 if (!(file->f_flags & O_DIRECT))
1094 if ((file->f_flags & (O_ACCMODE | O_APPEND)) == O_RDONLY)
1096 cifs_invalidate_cache(file_inode(file), FSCACHE_INVAL_DIO_WRITE);
1191 cifs_dbg(FYI, "inode = 0x%p file flags 0x%x for %s\n",
1256 * file might have write behind data that needs to be flushed and server
1257 * version of file size can be stale. If we knew for sure that inode was
1262 /* durable handle timeout is expired - open the file again */
1264 /* indicate that we need to relock the file */
1309 * would invalidate the current end of file on the server we can not go
1357 int cifs_close(struct inode *inode, struct file *file)
1364 cifs_fscache_unuse_inode_cookie(inode, file->f_mode & FMODE_WRITE);
1366 if (file->private_data != NULL) {
1367 cfile = file->private_data;
1368 file->private_data = NULL;
1439 int cifs_closedir(struct inode *inode, struct file *file)
1443 struct cifsFileInfo *cfile = file->private_data;
1483 kfree(file->private_data);
1484 file->private_data = NULL;
1683 cifs_posix_lock_test(struct file *file, struct file_lock *flock)
1686 struct cifsInodeInfo *cinode = CIFS_I(file_inode(file));
1693 posix_test_lock(file, flock);
1712 cifs_posix_lock_set(struct file *file, struct file_lock *flock)
1714 struct cifsInodeInfo *cinode = CIFS_I(file_inode(file));
1726 rc = posix_lock_file(file, flock, NULL);
1962 cifs_dbg(FYI, "Lease on file - not implemented yet\n");
1996 cifs_getlk(struct file *file, struct file_lock *flock, __u32 type,
2001 struct cifsFileInfo *cfile = (struct cifsFileInfo *)file->private_data;
2010 rc = cifs_posix_lock_test(file, flock);
2140 * a lock from the file's list.
2154 * the file's list if the unlock range request fails on
2166 * list to the head of the file's list.
2201 cifs_setlk(struct file *file, struct file_lock *flock, __u32 type,
2207 struct cifsFileInfo *cfile = (struct cifsFileInfo *)file->private_data;
2216 rc = cifs_posix_lock_set(file, flock);
2253 * if we set a byte-range lock on a file - break it explicitly
2281 * are closing the file, it doesn't matter if the
2283 * remove the lock on file close
2290 rc = locks_lock_file_wait(file, flock);
2295 int cifs_flock(struct file *file, int cmd, struct file_lock *fl)
2314 cfile = (struct cifsFileInfo *)file->private_data;
2319 cifs_sb = CIFS_FILE_SB(file);
2336 rc = cifs_setlk(file, fl, type, wait_flag, posix_lck, lock, unlock,
2344 int cifs_lock(struct file *file, int cmd, struct file_lock *flock)
2358 cifs_dbg(FYI, "%s: %pD2 cmd=0x%x type=0x%x flags=0x%x r=%lld:%lld\n", __func__, file, cmd,
2363 cfile = (struct cifsFileInfo *)file->private_data;
2368 cifs_sb = CIFS_FILE_SB(file);
2380 rc = cifs_getlk(file, flock, type, wait_flag, posix_lck, xid);
2394 rc = cifs_setlk(file, flock, type, wait_flag, posix_lck, lock, unlock,
2435 /* found a good file */
2443 } else /* write only file */
2497 /* found a good writable file */
2621 * Flush data on a strict file.
2623 int cifs_strict_fsync(struct file *file, loff_t start, loff_t end,
2630 struct cifsFileInfo *smbfile = file->private_data;
2631 struct inode *inode = file_inode(file);
2634 rc = file_write_and_wait_range(file, start, end);
2642 cifs_dbg(FYI, "Sync file - name: %pD datasync: 0x%x\n",
2643 file, datasync);
2667 cifs_dbg(FYI, "ignore fsync for file not open for write\n");
2680 int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
2686 struct cifsFileInfo *smbfile = file->private_data;
2687 struct inode *inode = file_inode(file);
2688 struct cifs_sb_info *cifs_sb = CIFS_FILE_SB(file);
2690 rc = file_write_and_wait_range(file, start, end);
2692 trace_cifs_fsync_err(file_inode(file)->i_ino, rc);
2698 cifs_dbg(FYI, "Sync file - name: %pD datasync: 0x%x\n",
2699 file, datasync);
2715 cifs_dbg(FYI, "ignore fsync for file not open for write\n");
2726 * As file closes, flush all cached write data for this inode checking
2729 int cifs_flush(struct file *file, fl_owner_t id)
2731 struct inode *inode = file_inode(file);
2734 if (file->f_mode & FMODE_WRITE)
2737 cifs_dbg(FYI, "Flush inode %p file %p rc %d\n", inode, file, rc);
2740 rc = filemap_check_wb_err(file->f_mapping, 0);
2749 struct file *file = iocb->ki_filp;
2750 struct cifsFileInfo *cfile = (struct cifsFileInfo *)file->private_data;
2751 struct inode *inode = file->f_mapping->host;
2959 int cifs_file_strict_mmap(struct file *file, struct vm_area_struct *vma)
2962 struct inode *inode = file_inode(file);
2969 rc = generic_file_mmap(file, vma);
2977 int cifs_file_mmap(struct file *file, struct vm_area_struct *vma)
2983 rc = cifs_revalidate_file(file);
2988 rc = generic_file_mmap(file, vma);
3011 /* We do not want to update the file size from server for inodes
3013 the file - in the future we could consider allowing
3014 refreshing the inode only on increases in the file size
3100 * file handles but cached, then schedule deferred close immediately.
3115 * an acknowledgment to be sent when the file has already been closed.
3133 struct file *swap_file, sector_t *span)
3169 * TODO: Since file already open, we can't open with DENY_ALL here
3171 * from reading or writing the file
3178 static void cifs_swap_deactivate(struct file *file)
3180 struct cifsFileInfo *cfile = file->private_data;
3189 /* do we need to unpin (or unlock) the file */