Lines Matching refs:file

3  * fs/sharefs/file.c
14 static int sharefs_readdir(struct file *file, struct dir_context *ctx)
17 struct file *lower_file = NULL;
18 struct dentry *dentry = file->f_path.dentry;
20 lower_file = sharefs_lower_file(file);
22 file->f_pos = lower_file->f_pos;
29 static int sharefs_open(struct inode *inode, struct file *file)
32 struct file *lower_file = NULL;
36 if (d_unhashed(file->f_path.dentry)) {
41 file->private_data =
43 if (!SHAREFS_F(file)) {
48 /* open lower object and link sharefs's file struct to lower's */
49 sharefs_get_lower_path(file->f_path.dentry, &lower_path);
50 lower_file = dentry_open(&lower_path, file->f_flags, current_cred());
54 lower_file = sharefs_lower_file(file);
56 sharefs_set_lower_file(file, NULL);
60 sharefs_set_lower_file(file, lower_file);
64 kfree(SHAREFS_F(file));
78 static int sharefs_flush(struct file *file, fl_owner_t id)
81 struct file *lower_file = NULL;
83 lower_file = sharefs_lower_file(file);
85 filemap_write_and_wait(file->f_mapping);
92 /* release all lower object references & free the file info structure */
93 static int sharefs_file_release(struct inode *inode, struct file *file)
95 struct file *lower_file;
97 lower_file = sharefs_lower_file(file);
99 sharefs_set_lower_file(file, NULL);
103 kfree(SHAREFS_F(file));
107 static int sharefs_fsync(struct file *file, loff_t start, loff_t end,
111 struct file *lower_file;
113 struct dentry *dentry = file->f_path.dentry;
115 err = __generic_file_fsync(file, start, end, datasync);
118 lower_file = sharefs_lower_file(file);
126 static int sharefs_fasync(int fd, struct file *file, int flag)
129 struct file *lower_file = NULL;
131 lower_file = sharefs_lower_file(file);
140 * only set the offset of the upper file. So we have to implement our
141 * own method to set both the upper and lower file offsets
144 static loff_t sharefs_file_llseek(struct file *file, loff_t offset, int whence)
147 struct file *lower_file;
149 lower_file = sharefs_lower_file(file);
150 lower_file->f_pos = file->f_pos;
152 file->f_pos = lower_file->f_pos;
163 struct file *file = iocb->ki_filp;
164 struct file *lower_file;
166 lower_file = sharefs_lower_file(file);
176 iocb->ki_filp = file;
181 fsstack_copy_attr_atime(d_inode(file->f_path.dentry),
193 struct file *file = iocb->ki_filp;
194 struct file *lower_file;
196 lower_file = sharefs_lower_file(file);
205 iocb->ki_filp = file;
209 fsstack_copy_inode_size(d_inode(file->f_path.dentry),
211 fsstack_copy_attr_times(d_inode(file->f_path.dentry),
218 int sharefs_file_mmap(struct file *file, struct vm_area_struct *vma)
221 struct file *lower_file;
223 lower_file = sharefs_lower_file(file);
230 if (WARN_ON(file != vma->vm_file))
238 fput(file);
240 file_accessed(file);