Lines Matching refs:file
56 static loff_t gfs2_llseek(struct file *file, loff_t offset, int whence) in gfs2_llseek() argument
58 struct gfs2_inode *ip = GFS2_I(file->f_mapping->host); in gfs2_llseek()
67 error = generic_file_llseek(file, offset, whence); in gfs2_llseek()
73 error = gfs2_seek_data(file, offset); in gfs2_llseek()
77 error = gfs2_seek_hole(file, offset); in gfs2_llseek()
86 error = generic_file_llseek(file, offset, whence); in gfs2_llseek()
103 static int gfs2_readdir(struct file *file, struct dir_context *ctx) in gfs2_readdir() argument
105 struct inode *dir = file->f_mapping->host; in gfs2_readdir()
114 error = gfs2_dir_read(dir, ctx, &file->f_ra); in gfs2_readdir()
156 static int gfs2_get_flags(struct file *filp, u32 __user *ptr) in gfs2_get_flags()
216 static int do_gfs2_set_flags(struct file *filp, u32 reqflags, u32 mask, in do_gfs2_set_flags()
299 static int gfs2_set_flags(struct file *filp, u32 __user *ptr) in gfs2_set_flags()
331 static int gfs2_getlabel(struct file *filp, char __user *label) in gfs2_getlabel()
342 static long gfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) in gfs2_ioctl()
359 static long gfs2_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) in gfs2_compat_ioctl()
395 static void gfs2_size_hint(struct file *filep, loff_t offset, size_t size) in gfs2_size_hint()
600 static int gfs2_mmap(struct file *file, struct vm_area_struct *vma) in gfs2_mmap() argument
602 struct gfs2_inode *ip = GFS2_I(file->f_mapping->host); in gfs2_mmap()
604 if (!(file->f_flags & O_NOATIME) && in gfs2_mmap()
615 file_accessed(file); in gfs2_mmap()
635 int gfs2_open_common(struct inode *inode, struct file *file) in gfs2_open_common() argument
641 ret = generic_file_open(inode, file); in gfs2_open_common()
652 gfs2_assert_warn(GFS2_SB(inode), !file->private_data); in gfs2_open_common()
653 file->private_data = fp; in gfs2_open_common()
654 if (file->f_mode & FMODE_WRITE) { in gfs2_open_common()
662 kfree(file->private_data); in gfs2_open_common()
663 file->private_data = NULL; in gfs2_open_common()
681 static int gfs2_open(struct inode *inode, struct file *file) in gfs2_open() argument
696 error = gfs2_open_common(inode, file); in gfs2_open()
712 static int gfs2_release(struct inode *inode, struct file *file) in gfs2_release() argument
716 kfree(file->private_data); in gfs2_release()
717 file->private_data = NULL; in gfs2_release()
719 if (file->f_mode & FMODE_WRITE) { in gfs2_release()
748 static int gfs2_fsync(struct file *file, loff_t start, loff_t end, in gfs2_fsync() argument
751 struct address_space *mapping = file->f_mapping; in gfs2_fsync()
773 ret = file_write_and_wait(file); in gfs2_fsync()
780 ret = file_fdatawait_range(file, start, end); in gfs2_fsync()
788 struct file *file = iocb->ki_filp; in gfs2_file_direct_read() local
789 struct gfs2_inode *ip = GFS2_I(file->f_mapping->host); in gfs2_file_direct_read()
813 struct file *file = iocb->ki_filp; in gfs2_file_direct_write() local
814 struct inode *inode = file->f_mapping->host; in gfs2_file_direct_write()
904 struct file *file = iocb->ki_filp; in gfs2_file_write_iter() local
905 struct inode *inode = file_inode(file); in gfs2_file_write_iter()
910 gfs2_size_hint(file, iocb->ki_pos, iov_iter_count(from)); in gfs2_file_write_iter()
924 ret = file_remove_privs(file); in gfs2_file_write_iter()
928 ret = file_update_time(file); in gfs2_file_write_iter()
933 struct address_space *mapping = file->f_mapping; in gfs2_file_write_iter()
1056 static long __gfs2_fallocate(struct file *file, int mode, loff_t offset, loff_t len) in __gfs2_fallocate() argument
1058 struct inode *inode = file_inode(file); in __gfs2_fallocate()
1083 gfs2_size_hint(file, offset, len); in __gfs2_fallocate()
1157 file_update_time(file); in __gfs2_fallocate()
1160 if ((file->f_flags & O_DSYNC) || IS_SYNC(file->f_mapping->host)) in __gfs2_fallocate()
1161 return vfs_fsync_range(file, pos, pos + count - 1, in __gfs2_fallocate()
1162 (file->f_flags & __O_SYNC) ? 0 : 1); in __gfs2_fallocate()
1172 static long gfs2_fallocate(struct file *file, int mode, loff_t offset, loff_t len) in gfs2_fallocate() argument
1174 struct inode *inode = file_inode(file); in gfs2_fallocate()
1205 ret = __gfs2_punch_hole(file, offset, len); in gfs2_fallocate()
1207 ret = __gfs2_fallocate(file, mode, offset, len); in gfs2_fallocate()
1222 struct file *out, loff_t *ppos, in gfs2_file_splice_write()
1244 static int gfs2_lock(struct file *file, int cmd, struct file_lock *fl) in gfs2_lock() argument
1246 struct gfs2_inode *ip = GFS2_I(file->f_mapping->host); in gfs2_lock()
1247 struct gfs2_sbd *sdp = GFS2_SB(file->f_mapping->host); in gfs2_lock()
1262 locks_lock_file_wait(file, fl); in gfs2_lock()
1266 return dlm_posix_get(ls->ls_dlm, ip->i_no_addr, file, fl); in gfs2_lock()
1268 return dlm_posix_unlock(ls->ls_dlm, ip->i_no_addr, file, fl); in gfs2_lock()
1270 return dlm_posix_lock(ls->ls_dlm, ip->i_no_addr, file, cmd, fl); in gfs2_lock()
1273 static int do_flock(struct file *file, int cmd, struct file_lock *fl) in do_flock() argument
1275 struct gfs2_file *fp = file->private_data; in do_flock()
1277 struct gfs2_inode *ip = GFS2_I(file_inode(file)); in do_flock()
1296 locks_lock_file_wait(file, &request); in do_flock()
1320 error = locks_lock_file_wait(file, fl); in do_flock()
1329 static void do_unflock(struct file *file, struct file_lock *fl) in do_unflock() argument
1331 struct gfs2_file *fp = file->private_data; in do_unflock()
1335 locks_lock_file_wait(file, fl); in do_unflock()
1352 static int gfs2_flock(struct file *file, int cmd, struct file_lock *fl) in gfs2_flock() argument
1360 do_unflock(file, fl); in gfs2_flock()
1363 return do_flock(file, cmd, fl); in gfs2_flock()