Lines Matching full:file
3 * fs/sharefs/file.c
14 static int sharefs_open(struct inode *inode, struct file *file) in sharefs_open() argument
17 struct file *lower_file = NULL; in sharefs_open()
21 if (d_unhashed(file->f_path.dentry)) { in sharefs_open()
26 file->private_data = in sharefs_open()
28 if (!SHAREFS_F(file)) { in sharefs_open()
33 /* open lower object and link sharefs's file struct to lower's */ in sharefs_open()
34 sharefs_get_lower_path(file->f_path.dentry, &lower_path); in sharefs_open()
35 lower_file = dentry_open(&lower_path, file->f_flags, current_cred()); in sharefs_open()
39 lower_file = sharefs_lower_file(file); in sharefs_open()
41 sharefs_set_lower_file(file, NULL); in sharefs_open()
45 sharefs_set_lower_file(file, lower_file); in sharefs_open()
49 kfree(SHAREFS_F(file)); in sharefs_open()
63 static int sharefs_flush(struct file *file, fl_owner_t id) in sharefs_flush() argument
66 struct file *lower_file = NULL; in sharefs_flush()
68 lower_file = sharefs_lower_file(file); in sharefs_flush()
70 filemap_write_and_wait(file->f_mapping); in sharefs_flush()
77 /* release all lower object references & free the file info structure */
78 static int sharefs_file_release(struct inode *inode, struct file *file) in sharefs_file_release() argument
80 struct file *lower_file; in sharefs_file_release()
82 lower_file = sharefs_lower_file(file); in sharefs_file_release()
84 sharefs_set_lower_file(file, NULL); in sharefs_file_release()
88 kfree(SHAREFS_F(file)); in sharefs_file_release()
92 static int sharefs_fsync(struct file *file, loff_t start, loff_t end, in sharefs_fsync() argument
96 struct file *lower_file; in sharefs_fsync()
98 struct dentry *dentry = file->f_path.dentry; in sharefs_fsync()
100 err = __generic_file_fsync(file, start, end, datasync); in sharefs_fsync()
103 lower_file = sharefs_lower_file(file); in sharefs_fsync()
111 static int sharefs_fasync(int fd, struct file *file, int flag) in sharefs_fasync() argument
114 struct file *lower_file = NULL; in sharefs_fasync()
116 lower_file = sharefs_lower_file(file); in sharefs_fasync()
125 * only set the offset of the upper file. So we have to implement our
126 * own method to set both the upper and lower file offsets
129 static loff_t sharefs_file_llseek(struct file *file, loff_t offset, int whence) in sharefs_file_llseek() argument
132 struct file *lower_file; in sharefs_file_llseek()
134 err = generic_file_llseek(file, offset, whence); in sharefs_file_llseek()
138 lower_file = sharefs_lower_file(file); in sharefs_file_llseek()
152 struct file *file = iocb->ki_filp, *lower_file; in sharefs_read_iter() local
154 lower_file = sharefs_lower_file(file); in sharefs_read_iter()
164 iocb->ki_filp = file; in sharefs_read_iter()
169 fsstack_copy_attr_atime(d_inode(file->f_path.dentry), in sharefs_read_iter()
182 struct file *file = iocb->ki_filp, *lower_file; in sharefs_write_iter() local
184 lower_file = sharefs_lower_file(file); in sharefs_write_iter()
193 iocb->ki_filp = file; in sharefs_write_iter()
197 fsstack_copy_inode_size(d_inode(file->f_path.dentry), in sharefs_write_iter()
199 fsstack_copy_attr_times(d_inode(file->f_path.dentry), in sharefs_write_iter()