Home
last modified time | relevance | path

Searched refs:file (Results 1 – 25 of 598) sorted by relevance

12345678910>>...24

/fs/overlayfs/
Dfile.c41 static struct file *ovl_open_realfile(const struct file *file, in ovl_open_realfile() argument
44 struct inode *inode = file_inode(file); in ovl_open_realfile()
45 struct file *realfile; in ovl_open_realfile()
47 int flags = file->f_flags | OVL_OPEN_FLAGS; in ovl_open_realfile()
63 realfile = open_with_fake_path(&file->f_path, flags, realinode, in ovl_open_realfile()
69 file, file, ovl_whatisit(inode, realinode), file->f_flags, in ovl_open_realfile()
77 static int ovl_change_flags(struct file *file, unsigned int flags) in ovl_change_flags() argument
79 struct inode *inode = file_inode(file); in ovl_change_flags()
84 if (((flags ^ file->f_flags) & O_APPEND) && IS_APPEND(inode)) in ovl_change_flags()
88 if (!file->f_mapping->a_ops || in ovl_change_flags()
[all …]
/fs/
Dfile_table.c47 struct file *f = container_of(head, struct file, f_u.fu_rcuhead); in file_free_rcu()
53 static inline void file_free(struct file *f) in file_free()
96 static struct file *__alloc_file(int flags, const struct cred *cred) in __alloc_file()
98 struct file *f; in __alloc_file()
133 struct file *alloc_empty_file(int flags, const struct cred *cred) in alloc_empty_file()
136 struct file *f; in alloc_empty_file()
170 struct file *alloc_empty_file_noaccount(int flags, const struct cred *cred) in alloc_empty_file_noaccount()
172 struct file *f = __alloc_file(flags, cred); in alloc_empty_file_noaccount()
187 static struct file *alloc_file(const struct path *path, int flags, in alloc_file()
190 struct file *file; in alloc_file() local
[all …]
Dread_write.c37 static inline bool unsigned_offsets(struct file *file) in unsigned_offsets() argument
39 return file->f_mode & FMODE_UNSIGNED_OFFSET; in unsigned_offsets()
54 loff_t vfs_setpos(struct file *file, loff_t offset, loff_t maxsize) in vfs_setpos() argument
56 if (offset < 0 && !unsigned_offsets(file)) in vfs_setpos()
61 if (offset != file->f_pos) { in vfs_setpos()
62 file->f_pos = offset; in vfs_setpos()
63 file->f_version = 0; in vfs_setpos()
86 generic_file_llseek_size(struct file *file, loff_t offset, int whence, in generic_file_llseek_size() argument
101 return file->f_pos; in generic_file_llseek_size()
107 spin_lock(&file->f_lock); in generic_file_llseek_size()
[all …]
Dfile.c82 cpy = ofdt->max_fds * sizeof(struct file *); in copy_fdtable()
83 set = (nfdt->max_fds - ofdt->max_fds) * sizeof(struct file *); in copy_fdtable()
117 nr /= (1024 / sizeof(struct file *)); in alloc_fdtable()
119 nr *= (1024 / sizeof(struct file *)); in alloc_fdtable()
136 data = kvmalloc_array(nr, sizeof(struct file *), GFP_KERNEL_ACCOUNT); in alloc_fdtable()
319 struct file **old_fds, **new_fds; in dup_fd()
383 struct file *f = *old_fds++; in dup_fd()
400 memset(new_fds, 0, (new_fdt->max_fds - open_files) * sizeof(struct file *)); in dup_fd()
430 struct file * file = xchg(&fdt->fd[i], NULL); in close_files() local
431 if (file) { in close_files()
[all …]
Dkernel_read_file.c35 int kernel_read_file(struct file *file, loff_t offset, void **buf, in kernel_read_file() argument
48 if (!S_ISREG(file_inode(file)->i_mode)) in kernel_read_file()
51 ret = deny_write_access(file); in kernel_read_file()
55 i_size = i_size_read(file_inode(file)); in kernel_read_file()
72 ret = security_kernel_read_file(file, id, whole_file); in kernel_read_file()
93 bytes = kernel_read(file, *buf + copied, wanted, &pos); in kernel_read_file()
110 ret = security_kernel_post_read_file(file, *buf, i_size, id); in kernel_read_file()
122 allow_write_access(file); in kernel_read_file()
131 struct file *file; in kernel_read_file_from_path() local
137 file = filp_open(path, O_RDONLY, 0); in kernel_read_file_from_path()
[all …]
Deventfd.c121 static int eventfd_release(struct inode *inode, struct file *file) in eventfd_release() argument
123 struct eventfd_ctx *ctx = file->private_data; in eventfd_release()
130 static __poll_t eventfd_poll(struct file *file, poll_table *wait) in eventfd_poll() argument
132 struct eventfd_ctx *ctx = file->private_data; in eventfd_poll()
136 poll_wait(file, &ctx->wqh, wait); in eventfd_poll()
228 struct file *file = iocb->ki_filp; in eventfd_read() local
229 struct eventfd_ctx *ctx = file->private_data; in eventfd_read()
237 if ((file->f_flags & O_NONBLOCK) || in eventfd_read()
272 static ssize_t eventfd_write(struct file *file, const char __user *buf, size_t count, in eventfd_write() argument
275 struct eventfd_ctx *ctx = file->private_data; in eventfd_write()
[all …]
Dioctl.c44 long vfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) in vfs_ioctl()
59 static int ioctl_fibmap(struct file *filp, int __user *p) in ioctl_fibmap()
199 static int ioctl_fiemap(struct file *filp, struct fiemap __user *ufiemap) in ioctl_fiemap()
230 static long ioctl_file_clone(struct file *dst_file, unsigned long srcfd, in ioctl_file_clone()
237 if (!src_file.file) in ioctl_file_clone()
240 if (src_file.file->f_path.mnt != dst_file->f_path.mnt) in ioctl_file_clone()
242 cloned = vfs_clone_file_range(src_file.file, off, dst_file, destoff, in ioctl_file_clone()
255 static long ioctl_file_clone_range(struct file *file, in ioctl_file_clone_range() argument
262 return ioctl_file_clone(file, args.src_fd, args.src_offset, in ioctl_file_clone_range()
273 static int ioctl_preallocate(struct file *filp, int mode, void __user *argp) in ioctl_preallocate()
[all …]
Deventpoll.c111 struct file *file; member
217 struct file *file; member
280 static void list_file(struct file *file) in list_file() argument
284 head = container_of(file->f_ep, struct epitems_head, epitems); in list_file()
297 spin_lock(&epi->ffd.file->f_lock); in unlist_file()
301 spin_unlock(&epi->ffd.file->f_lock); in unlist_file()
329 static inline int is_file_epoll(struct file *f) in is_file_epoll()
336 struct file *file, int fd) in ep_set_ffd() argument
338 ffd->file = file; in ep_set_ffd()
346 return (p1->file > p2->file ? +1: in ep_cmp_ffd()
[all …]
Dopen.c41 loff_t length, unsigned int time_attrs, struct file *filp) in do_truncate()
169 if (!f.file) in do_sys_ftruncate()
173 if (f.file->f_flags & O_LARGEFILE) in do_sys_ftruncate()
176 dentry = f.file->f_path.dentry; in do_sys_ftruncate()
179 if (!S_ISREG(inode->i_mode) || !(f.file->f_mode & FMODE_WRITE)) in do_sys_ftruncate()
189 if (IS_APPEND(file_inode(f.file))) in do_sys_ftruncate()
192 error = security_path_truncate(&f.file->f_path); in do_sys_ftruncate()
194 error = do_truncate(file_mnt_user_ns(f.file), dentry, length, in do_sys_ftruncate()
195 ATTR_MTIME | ATTR_CTIME, f.file); in do_sys_ftruncate()
229 int vfs_fallocate(struct file *file, int mode, loff_t offset, loff_t len) in vfs_fallocate() argument
[all …]
Dlibfs.c80 int dcache_dir_open(struct inode *inode, struct file *file) in dcache_dir_open() argument
82 file->private_data = d_alloc_cursor(file->f_path.dentry); in dcache_dir_open()
84 return file->private_data ? 0 : -ENOMEM; in dcache_dir_open()
88 int dcache_dir_close(struct inode *inode, struct file *file) in dcache_dir_close() argument
90 dput(file->private_data); in dcache_dir_close()
137 loff_t dcache_dir_lseek(struct file *file, loff_t offset, int whence) in dcache_dir_lseek() argument
139 struct dentry *dentry = file->f_path.dentry; in dcache_dir_lseek()
142 offset += file->f_pos; in dcache_dir_lseek()
151 if (offset != file->f_pos) { in dcache_dir_lseek()
152 struct dentry *cursor = file->private_data; in dcache_dir_lseek()
[all …]
/fs/lockd/
Dsvcsubs.c46 static inline void nlm_debug_print_file(char *msg, struct nlm_file *file) in nlm_debug_print_file() argument
48 struct inode *inode = nlmsvc_file_inode(file); in nlm_debug_print_file()
59 static inline void nlm_debug_print_file(char *msg, struct nlm_file *file) in nlm_debug_print_file() argument
87 struct nlm_file *file, int mode) in nlm_do_fopen() argument
89 struct file **fp = &file->f_file[mode]; in nlm_do_fopen()
94 nfserr = nlmsvc_ops->fopen(rqstp, &file->f_handle, fp, mode); in nlm_do_fopen()
108 struct nlm_file *file; in nlm_lookup_file() local
121 hlist_for_each_entry(file, &nlm_files[hash], f_list) in nlm_lookup_file()
122 if (!nfs_compare_fh(&file->f_handle, &lock->fh)) { in nlm_lookup_file()
123 mutex_lock(&file->f_mutex); in nlm_lookup_file()
[all …]
/fs/ecryptfs/
Dfile.c37 struct file *file = iocb->ki_filp; in ecryptfs_read_update_atime() local
41 path = ecryptfs_dentry_to_lower_path(file->f_path.dentry); in ecryptfs_read_update_atime()
101 static int ecryptfs_readdir(struct file *file, struct dir_context *ctx) in ecryptfs_readdir() argument
104 struct file *lower_file; in ecryptfs_readdir()
105 struct inode *inode = file_inode(file); in ecryptfs_readdir()
111 lower_file = ecryptfs_file_to_lower(file); in ecryptfs_readdir()
169 static int ecryptfs_mmap(struct file *file, struct vm_area_struct *vma) in ecryptfs_mmap() argument
171 struct file *lower_file = ecryptfs_file_to_lower(file); in ecryptfs_mmap()
179 return generic_file_mmap(file, vma); in ecryptfs_mmap()
191 static int ecryptfs_open(struct inode *inode, struct file *file) in ecryptfs_open() argument
[all …]
/fs/proc/
Dinode.c238 struct file *file; in close_pdeo() local
243 file = pdeo->file; in close_pdeo()
244 pde->proc_ops->proc_release(file_inode(file), file); in close_pdeo()
276 static loff_t proc_reg_llseek(struct file *file, loff_t offset, int whence) in proc_reg_llseek() argument
278 struct proc_dir_entry *pde = PDE(file_inode(file)); in proc_reg_llseek()
282 return pde->proc_ops->proc_lseek(file, offset, whence); in proc_reg_llseek()
284 rv = pde->proc_ops->proc_lseek(file, offset, whence); in proc_reg_llseek()
305 static ssize_t pde_read(struct proc_dir_entry *pde, struct file *file, char __user *buf, size_t cou… in pde_read() argument
311 return read(file, buf, count, ppos); in pde_read()
315 static ssize_t proc_reg_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) in proc_reg_read() argument
[all …]
Dfd.c25 struct file *file = NULL; in seq_show() local
38 file = files_lookup_fd_locked(files, fd); in seq_show()
39 if (file) { in seq_show()
42 f_flags = file->f_flags; in seq_show()
46 get_file(file); in seq_show()
58 (long long)file->f_pos, f_flags, in seq_show()
59 real_mount(file->f_path.mnt)->mnt_id, in seq_show()
60 file_inode(file)->i_ino); in seq_show()
63 show_fd_locks(m, file, files); in seq_show()
67 if (file->f_op->show_fdinfo) in seq_show()
[all …]
/fs/nfsd/
Dnfsctl.c65 static ssize_t write_filehandle(struct file *file, char *buf, size_t size);
66 static ssize_t write_unlock_ip(struct file *file, char *buf, size_t size);
67 static ssize_t write_unlock_fs(struct file *file, char *buf, size_t size);
68 static ssize_t write_threads(struct file *file, char *buf, size_t size);
69 static ssize_t write_pool_threads(struct file *file, char *buf, size_t size);
70 static ssize_t write_versions(struct file *file, char *buf, size_t size);
71 static ssize_t write_ports(struct file *file, char *buf, size_t size);
72 static ssize_t write_maxblksize(struct file *file, char *buf, size_t size);
73 static ssize_t write_maxconn(struct file *file, char *buf, size_t size);
75 static ssize_t write_leasetime(struct file *file, char *buf, size_t size);
[all …]
/fs/nfs/
Dfile.c65 nfs_file_open(struct inode *inode, struct file *filp) in nfs_file_open()
81 nfs_file_release(struct inode *inode, struct file *filp) in nfs_file_release()
102 static int nfs_revalidate_file_size(struct inode *inode, struct file *filp) in nfs_revalidate_file_size()
115 loff_t nfs_file_llseek(struct file *filp, loff_t offset, int whence) in nfs_file_llseek()
140 nfs_file_flush(struct file *file, fl_owner_t id) in nfs_file_flush() argument
142 struct inode *inode = file_inode(file); in nfs_file_flush()
145 dprintk("NFS: flush(%pD2)\n", file); in nfs_file_flush()
148 if ((file->f_mode & FMODE_WRITE) == 0) in nfs_file_flush()
152 since = filemap_sample_wb_err(file->f_mapping); in nfs_file_flush()
154 return filemap_check_wb_err(file->f_mapping, since); in nfs_file_flush()
[all …]
/fs/ocfs2/
Dlocks.c22 static int ocfs2_do_flock(struct file *file, struct inode *inode, in ocfs2_do_flock() argument
26 struct ocfs2_file_private *fp = file->private_data; in ocfs2_do_flock()
57 locks_lock_file_wait(file, &request); in ocfs2_do_flock()
59 ocfs2_file_unlock(file); in ocfs2_do_flock()
62 ret = ocfs2_file_lock(file, level, trylock); in ocfs2_do_flock()
71 ret = locks_lock_file_wait(file, fl); in ocfs2_do_flock()
73 ocfs2_file_unlock(file); in ocfs2_do_flock()
81 static int ocfs2_do_funlock(struct file *file, int cmd, struct file_lock *fl) in ocfs2_do_funlock() argument
84 struct ocfs2_file_private *fp = file->private_data; in ocfs2_do_funlock()
87 ocfs2_file_unlock(file); in ocfs2_do_funlock()
[all …]
/fs/ceph/
Dioctl.c17 static long ceph_ioctl_get_layout(struct file *file, void __user *arg) in ceph_ioctl_get_layout() argument
19 struct ceph_inode_info *ci = ceph_inode(file_inode(file)); in ceph_ioctl_get_layout()
23 err = ceph_do_getattr(file_inode(file), CEPH_STAT_CAP_LAYOUT, false); in ceph_ioctl_get_layout()
64 static long ceph_ioctl_set_layout(struct file *file, void __user *arg) in ceph_ioctl_set_layout() argument
66 struct inode *inode = file_inode(file); in ceph_ioctl_set_layout()
70 struct ceph_inode_info *ci = ceph_inode(file_inode(file)); in ceph_ioctl_set_layout()
78 err = ceph_do_getattr(file_inode(file), CEPH_STAT_CAP_LAYOUT, false); in ceph_ioctl_set_layout()
136 static long ceph_ioctl_set_layout_policy (struct file *file, void __user *arg) in ceph_ioctl_set_layout_policy() argument
138 struct inode *inode = file_inode(file); in ceph_ioctl_set_layout_policy()
179 static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg) in ceph_ioctl_get_dataloc() argument
[all …]
/fs/cifs/
Dcifsfs.h55 struct file *, unsigned, umode_t);
68 extern int cifs_revalidate_file_attr(struct file *filp);
70 extern int cifs_revalidate_file(struct file *filp);
94 extern int cifs_open(struct inode *inode, struct file *file);
95 extern int cifs_close(struct inode *inode, struct file *file);
96 extern int cifs_closedir(struct inode *inode, struct file *file);
103 extern int cifs_flock(struct file *pfile, int cmd, struct file_lock *plock);
104 extern int cifs_lock(struct file *, int, struct file_lock *);
105 extern int cifs_fsync(struct file *, loff_t, loff_t, int);
106 extern int cifs_strict_fsync(struct file *, loff_t, loff_t, int);
[all …]
/fs/cachefiles/
Dio.c66 struct file *file = cres->cache_priv2; in cachefiles_read() local
72 file, file_inode(file)->i_ino, start_pos, len, in cachefiles_read()
73 i_size_read(file_inode(file))); in cachefiles_read()
81 off2 = vfs_llseek(file, off, SEEK_DATA); in cachefiles_read()
109 ki->iocb.ki_filp = file; in cachefiles_read()
112 ki->iocb.ki_hint = ki_hint_validate(file_write_hint(file)); in cachefiles_read()
125 ret = vfs_iocb_iter_read(file, &ki->iocb, iter); in cachefiles_read()
190 struct file *file = cres->cache_priv2; in cachefiles_write() local
196 file, file_inode(file)->i_ino, start_pos, len, in cachefiles_write()
197 i_size_read(file_inode(file))); in cachefiles_write()
[all …]
/fs/fuse/
Dreaddir.c34 static void fuse_add_dirent_to_cache(struct file *file, in fuse_add_dirent_to_cache() argument
37 struct fuse_inode *fi = get_fuse_inode(file_inode(file)); in fuse_add_dirent_to_cache()
67 page = find_lock_page(file->f_mapping, index); in fuse_add_dirent_to_cache()
69 page = find_or_create_page(file->f_mapping, index, in fuse_add_dirent_to_cache()
70 mapping_gfp_mask(file->f_mapping)); in fuse_add_dirent_to_cache()
96 static void fuse_readdir_cache_end(struct file *file, loff_t pos) in fuse_readdir_cache_end() argument
98 struct fuse_inode *fi = get_fuse_inode(file_inode(file)); in fuse_readdir_cache_end()
113 truncate_inode_pages(file->f_mapping, end); in fuse_readdir_cache_end()
116 static bool fuse_emit(struct file *file, struct dir_context *ctx, in fuse_emit() argument
119 struct fuse_file *ff = file->private_data; in fuse_emit()
[all …]
Dfuse_i.h256 struct file *filp;
313 struct file *backing_file;
583 struct file *file; member
604 struct file *root_dir;
1091 void fuse_read_args_fill(struct fuse_io_args *ia, struct file *file, loff_t pos,
1097 int fuse_open_common(struct inode *inode, struct file *file, bool isdir);
1101 void fuse_finish_open(struct inode *inode, struct file *file);
1109 void fuse_release_common(struct file *file, bool isdir);
1114 int fuse_fsync_common(struct file *file, loff_t start, loff_t end,
1191 void fuse_init_dentry_root(struct dentry *root, struct file *backing_dir);
[all …]
/fs/ext4/
Ddir.c33 static int ext4_dx_readdir(struct file *, struct dir_context *);
79 struct inode *dir, struct file *filp, in __ext4_check_dir_entry()
126 static int ext4_readdir(struct file *file, struct dir_context *ctx) in ext4_readdir() argument
132 struct inode *inode = file_inode(file); in ext4_readdir()
142 err = ext4_dx_readdir(file, ctx); in ext4_readdir()
158 err = ext4_read_inline_dir(file, ctx, in ext4_readdir()
193 if (!ra_has_index(&file->f_ra, index)) in ext4_readdir()
196 &file->f_ra, file, in ext4_readdir()
198 file->f_ra.prev_pos = (loff_t)index << PAGE_SHIFT; in ext4_readdir()
218 EXT4_ERROR_FILE(file, 0, "directory fails checksum " in ext4_readdir()
[all …]
/fs/gfs2/
Dfile.c57 static loff_t gfs2_llseek(struct file *file, loff_t offset, int whence) in gfs2_llseek() argument
59 struct gfs2_inode *ip = GFS2_I(file->f_mapping->host); in gfs2_llseek()
68 error = generic_file_llseek(file, offset, whence); in gfs2_llseek()
74 error = gfs2_seek_data(file, offset); in gfs2_llseek()
78 error = gfs2_seek_hole(file, offset); in gfs2_llseek()
87 error = generic_file_llseek(file, offset, whence); in gfs2_llseek()
104 static int gfs2_readdir(struct file *file, struct dir_context *ctx) in gfs2_readdir() argument
106 struct inode *dir = file->f_mapping->host; in gfs2_readdir()
115 error = gfs2_dir_read(dir, ctx, &file->f_ra); in gfs2_readdir()
319 static int gfs2_getlabel(struct file *filp, char __user *label) in gfs2_getlabel()
[all …]
/fs/configfs/
Dfile.c49 static inline struct configfs_fragment *to_frag(struct file *file) in to_frag() argument
51 struct configfs_dirent *sd = file->f_path.dentry->d_fsdata; in to_frag()
56 static int fill_read_buffer(struct file *file, struct configfs_buffer *buffer) in fill_read_buffer() argument
58 struct configfs_fragment *frag = to_frag(file); in fill_read_buffer()
82 struct file *file = iocb->ki_filp; in configfs_read_iter() local
83 struct configfs_buffer *buffer = file->private_data; in configfs_read_iter()
88 retval = fill_read_buffer(file, buffer); in configfs_read_iter()
108 struct file *file = iocb->ki_filp; in configfs_bin_read_iter() local
109 struct configfs_fragment *frag = to_frag(file); in configfs_bin_read_iter()
110 struct configfs_buffer *buffer = file->private_data; in configfs_bin_read_iter()
[all …]

12345678910>>...24