• Home
  • Raw
  • Download

Lines Matching refs:file

22 int hmdfs_file_open_local(struct inode *inode, struct file *file)  in hmdfs_file_open_local()  argument
25 struct file *lower_file = NULL; in hmdfs_file_open_local()
36 hmdfs_get_lower_path(file->f_path.dentry, &lower_path); in hmdfs_file_open_local()
37 lower_file = dentry_open(&lower_path, file->f_flags, cred); in hmdfs_file_open_local()
44 file->private_data = gfi; in hmdfs_file_open_local()
50 int hmdfs_file_release_local(struct inode *inode, struct file *file) in hmdfs_file_release_local() argument
52 struct hmdfs_file_info *gfi = hmdfs_f(file); in hmdfs_file_release_local()
54 file->private_data = NULL; in hmdfs_file_release_local()
60 static void hmdfs_file_accessed(struct file *file) in hmdfs_file_accessed() argument
62 struct file *lower_file = hmdfs_f(file)->lower_file; in hmdfs_file_accessed()
63 struct inode *inode = file_inode(file); in hmdfs_file_accessed()
66 if (file->f_flags & O_NOATIME) in hmdfs_file_accessed()
72 ssize_t hmdfs_do_read_iter(struct file *file, struct iov_iter *iter, in hmdfs_do_read_iter() argument
76 struct file *lower_file = hmdfs_f(file)->lower_file; in hmdfs_do_read_iter()
82 hmdfs_file_accessed(file); in hmdfs_do_read_iter()
92 static void hmdfs_file_modified(struct file *file) in hmdfs_file_modified() argument
94 struct inode *inode = file_inode(file); in hmdfs_file_modified()
95 struct dentry *dentry = file_dentry(file); in hmdfs_file_modified()
96 struct file *lower_file = hmdfs_f(file)->lower_file; in hmdfs_file_modified()
108 ssize_t hmdfs_do_write_iter(struct file *file, struct iov_iter *iter, in hmdfs_do_write_iter() argument
112 struct file *lower_file = hmdfs_f(file)->lower_file; in hmdfs_do_write_iter()
113 struct inode *inode = file_inode(file); in hmdfs_do_write_iter()
120 ret = file_remove_privs(file); in hmdfs_do_write_iter()
128 hmdfs_file_modified(file); in hmdfs_do_write_iter()
140 int hmdfs_fsync_local(struct file *file, loff_t start, loff_t end, int datasync) in hmdfs_fsync_local() argument
143 struct file *lower_file = hmdfs_f(file)->lower_file; in hmdfs_fsync_local()
145 err = __generic_file_fsync(file, start, end, datasync); in hmdfs_fsync_local()
154 loff_t hmdfs_file_llseek_local(struct file *file, loff_t offset, int whence) in hmdfs_file_llseek_local() argument
157 struct file *lower_file = NULL; in hmdfs_file_llseek_local()
159 err = generic_file_llseek(file, offset, whence); in hmdfs_file_llseek_local()
162 lower_file = hmdfs_f(file)->lower_file; in hmdfs_file_llseek_local()
168 int hmdfs_file_mmap_local(struct file *file, struct vm_area_struct *vma) in hmdfs_file_mmap_local() argument
170 struct hmdfs_file_info *private_data = file->private_data; in hmdfs_file_mmap_local()
171 struct file *realfile = NULL; in hmdfs_file_mmap_local()
184 if (WARN_ON(file != vma->vm_file)) in hmdfs_file_mmap_local()
192 fput(file); in hmdfs_file_mmap_local()
194 file_accessed(file); in hmdfs_file_mmap_local()
210 static int hmdfs_iterate_local(struct file *file, struct dir_context *ctx) in hmdfs_iterate_local() argument
214 struct file *lower_file = hmdfs_f(file)->lower_file; in hmdfs_iterate_local()
219 lower_file->f_pos = file->f_pos; in hmdfs_iterate_local()
221 file->f_pos = lower_file->f_pos; in hmdfs_iterate_local()
226 trace_hmdfs_iterate_local(file->f_path.dentry, start_pos, ctx->pos, in hmdfs_iterate_local()
231 int hmdfs_dir_open_local(struct inode *inode, struct file *file) in hmdfs_dir_open_local() argument
234 struct file *lower_file = NULL; in hmdfs_dir_open_local()
235 struct dentry *dentry = file->f_path.dentry; in hmdfs_dir_open_local()
249 lower_file = dentry_open(&lower_path, file->f_flags, cred); in hmdfs_dir_open_local()
256 file->private_data = gfi; in hmdfs_dir_open_local()
265 static int hmdfs_dir_release_local(struct inode *inode, struct file *file) in hmdfs_dir_release_local() argument
267 struct hmdfs_file_info *gfi = hmdfs_f(file); in hmdfs_dir_release_local()
269 file->private_data = NULL; in hmdfs_dir_release_local()
280 bool hmdfs_is_share_file(struct file *file) in hmdfs_is_share_file() argument
282 struct file *cur_file = file; in hmdfs_is_share_file()
311 fput(item->file); in release_share_item()
348 struct qstr *relative_path, struct file *file, char *cid) in hmdfs_insert_share_item() argument
360 new_item->file = file; in hmdfs_insert_share_item()
361 get_file(file); in hmdfs_insert_share_item()
377 struct file *file, char *cid) in hmdfs_update_share_item() argument
380 if (!hmdfs_is_dst_path(&file->f_path, &item->file->f_path)) { in hmdfs_update_share_item()
381 fput(item->file); in hmdfs_update_share_item()
382 item->file = file; in hmdfs_update_share_item()
383 get_file(file); in hmdfs_update_share_item()
391 static int hmdfs_add_to_share_table(struct file *file, in hmdfs_add_to_share_table() argument
402 if (!src.file) in hmdfs_add_to_share_table()
405 if (!S_ISREG(src.file->f_inode->i_mode)) { in hmdfs_add_to_share_table()
410 if (hmdfs_is_share_file(src.file)) { in hmdfs_add_to_share_table()
415 dir_path = hmdfs_get_dentry_relative_path(file->f_path.dentry); in hmdfs_add_to_share_table()
421 dentry = src.file->f_path.dentry; in hmdfs_add_to_share_table()
441 src.file, sc->cid); in hmdfs_add_to_share_table()
446 hmdfs_update_share_item(item, src.file, sc->cid); in hmdfs_add_to_share_table()
459 static int hmdfs_ioc_set_share_path(struct file *file, unsigned long arg) in hmdfs_ioc_set_share_path() argument
462 struct super_block *sb = file->f_inode->i_sb; in hmdfs_ioc_set_share_path()
470 error = hmdfs_add_to_share_table(file, sbi, &sc); in hmdfs_ioc_set_share_path()
475 static long hmdfs_dir_ioctl_local(struct file *file, unsigned int cmd, in hmdfs_dir_ioctl_local() argument
480 return hmdfs_ioc_set_share_path(file, arg); in hmdfs_dir_ioctl_local()