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);
98 * @file: The eCryptfs directory file
101 static int ecryptfs_readdir(struct file *file, struct dir_context *ctx)
104 struct file *lower_file;
105 struct inode *inode = file_inode(file);
111 lower_file = ecryptfs_file_to_lower(file);
169 static int ecryptfs_mmap(struct file *file, struct vm_area_struct *vma)
171 struct file *lower_file = ecryptfs_file_to_lower(file);
173 * Don't allow mmap on top of file systems that don't support it
179 return generic_file_mmap(file, vma);
184 * @inode: inode specifying file to open
185 * @file: Structure to return filled in
187 * Opens the file specified by inode.
191 static int ecryptfs_open(struct inode *inode, struct file *file)
195 struct dentry *ecryptfs_dentry = file->f_path.dentry;
202 ecryptfs_set_file_private(file, file_info);
221 "the lower file for the dentry with name "
227 == O_RDONLY && (file->f_flags & O_ACCMODE) != O_RDONLY) {
229 printk(KERN_WARNING "%s: Lower file is RO; eCryptfs "
230 "file must hence be opened RO\n", __func__);
234 file, ecryptfs_inode_to_private(inode)->lower_file);
246 ecryptfs_file_to_private(file));
253 * @inode: inode specifying file to open
254 * @file: Structure to return filled in
256 * Opens the file specified by inode.
260 static int ecryptfs_dir_open(struct inode *inode, struct file *file)
262 struct dentry *ecryptfs_dentry = file->f_path.dentry;
266 struct file *lower_file;
270 ecryptfs_set_file_private(file, file_info);
277 file->f_flags, current_cred());
280 "the lower file for the dentry with name "
286 ecryptfs_set_file_lower(file, lower_file);
290 static int ecryptfs_flush(struct file *file, fl_owner_t td)
292 struct file *lower_file = ecryptfs_file_to_lower(file);
295 filemap_write_and_wait(file->f_mapping);
302 static int ecryptfs_release(struct inode *inode, struct file *file)
306 ecryptfs_file_to_private(file));
310 static int ecryptfs_dir_release(struct inode *inode, struct file *file)
312 fput(ecryptfs_file_to_lower(file));
314 ecryptfs_file_to_private(file));
318 static loff_t ecryptfs_dir_llseek(struct file *file, loff_t offset, int whence)
320 return vfs_llseek(ecryptfs_file_to_lower(file), offset, whence);
324 ecryptfs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
328 rc = file_write_and_wait(file);
332 return vfs_fsync(ecryptfs_file_to_lower(file), datasync);
335 static int ecryptfs_fasync(int fd, struct file *file, int flag)
338 struct file *lower_file = NULL;
340 lower_file = ecryptfs_file_to_lower(file);
347 ecryptfs_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
349 struct file *lower_file = ecryptfs_file_to_lower(file);
362 fsstack_copy_attr_all(file_inode(file), file_inode(lower_file));
372 ecryptfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
374 struct file *lower_file = ecryptfs_file_to_lower(file);
387 fsstack_copy_attr_all(file_inode(file), file_inode(lower_file));