Lines Matching refs:file

12 #include <linux/file.h>
29 * returns without any errors. This is to be used only for file reads.
37 struct file *file = iocb->ki_filp;
41 path = ecryptfs_dentry_to_lower_path(file->f_path.dentry);
54 * to be used only for file reads. The function to be used for directory reads
57 static ssize_t ecryptfs_splice_read_update_atime(struct file *in, loff_t *ppos,
123 * @file: The eCryptfs directory file
126 static int ecryptfs_readdir(struct file *file, struct dir_context *ctx)
129 struct file *lower_file;
130 struct inode *inode = file_inode(file);
136 lower_file = ecryptfs_file_to_lower(file);
188 static int ecryptfs_mmap(struct file *file, struct vm_area_struct *vma)
190 struct file *lower_file = ecryptfs_file_to_lower(file);
192 * Don't allow mmap on top of file systems that don't support it
198 return generic_file_mmap(file, vma);
203 * @inode: inode specifying file to open
204 * @file: Structure to return filled in
206 * Opens the file specified by inode.
210 static int ecryptfs_open(struct inode *inode, struct file *file)
214 struct dentry *ecryptfs_dentry = file->f_path.dentry;
221 ecryptfs_set_file_private(file, file_info);
240 "the lower file for the dentry with name "
246 == O_RDONLY && (file->f_flags & O_ACCMODE) != O_RDONLY) {
248 printk(KERN_WARNING "%s: Lower file is RO; eCryptfs "
249 "file must hence be opened RO\n", __func__);
253 file, ecryptfs_inode_to_private(inode)->lower_file);
265 ecryptfs_file_to_private(file));
272 * @inode: inode specifying file to open
273 * @file: Structure to return filled in
275 * Opens the file specified by inode.
279 static int ecryptfs_dir_open(struct inode *inode, struct file *file)
281 struct dentry *ecryptfs_dentry = file->f_path.dentry;
285 struct file *lower_file;
289 ecryptfs_set_file_private(file, file_info);
296 file->f_flags, current_cred());
299 "the lower file for the dentry with name "
305 ecryptfs_set_file_lower(file, lower_file);
309 static int ecryptfs_flush(struct file *file, fl_owner_t td)
311 struct file *lower_file = ecryptfs_file_to_lower(file);
314 filemap_write_and_wait(file->f_mapping);
321 static int ecryptfs_release(struct inode *inode, struct file *file)
325 ecryptfs_file_to_private(file));
329 static int ecryptfs_dir_release(struct inode *inode, struct file *file)
331 fput(ecryptfs_file_to_lower(file));
333 ecryptfs_file_to_private(file));
337 static loff_t ecryptfs_dir_llseek(struct file *file, loff_t offset, int whence)
339 return vfs_llseek(ecryptfs_file_to_lower(file), offset, whence);
343 ecryptfs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
347 rc = file_write_and_wait(file);
351 return vfs_fsync(ecryptfs_file_to_lower(file), datasync);
354 static int ecryptfs_fasync(int fd, struct file *file, int flag)
357 struct file *lower_file = NULL;
359 lower_file = ecryptfs_file_to_lower(file);
366 ecryptfs_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
368 struct file *lower_file = ecryptfs_file_to_lower(file);
381 fsstack_copy_attr_all(file_inode(file), file_inode(lower_file));
391 ecryptfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
393 struct file *lower_file = ecryptfs_file_to_lower(file);
406 fsstack_copy_attr_all(file_inode(file), file_inode(lower_file));