Home
last modified time | relevance | path

Searched refs:filp (Results 1 – 25 of 124) sorted by relevance

12345

/fs/
Dfcntl.c35 static int setfl(int fd, struct file * filp, unsigned long arg) in setfl() argument
37 struct inode * inode = file_inode(filp); in setfl()
44 if (((arg ^ filp->f_flags) & O_APPEND) && IS_APPEND(inode)) in setfl()
48 if ((arg & O_NOATIME) && !(filp->f_flags & O_NOATIME)) in setfl()
59 if (!filp->f_mapping || !filp->f_mapping->a_ops || in setfl()
60 !filp->f_mapping->a_ops->direct_IO) in setfl()
64 if (filp->f_op->check_flags) in setfl()
65 error = filp->f_op->check_flags(arg); in setfl()
72 if (((arg ^ filp->f_flags) & FASYNC) && filp->f_op->fasync) { in setfl()
73 error = filp->f_op->fasync(fd, filp, (arg & FASYNC) != 0); in setfl()
[all …]
Dioctl.c40 long vfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) in vfs_ioctl() argument
44 if (!filp->f_op->unlocked_ioctl) in vfs_ioctl()
47 error = filp->f_op->unlocked_ioctl(filp, cmd, arg); in vfs_ioctl()
55 static int ioctl_fibmap(struct file *filp, int __user *p) in ioctl_fibmap() argument
57 struct address_space *mapping = filp->f_mapping; in ioctl_fibmap()
178 static int ioctl_fiemap(struct file *filp, unsigned long arg) in ioctl_fiemap() argument
183 struct inode *inode = file_inode(filp); in ioctl_fiemap()
470 int ioctl_preallocate(struct file *filp, void __user *argp) in ioctl_preallocate() argument
472 struct inode *inode = file_inode(filp); in ioctl_preallocate()
482 sr.l_start += filp->f_pos; in ioctl_preallocate()
[all …]
Dlocks.c308 locks_check_ctx_file_list(struct file *filp, struct list_head *list, in locks_check_ctx_file_list() argument
312 struct inode *inode = locks_inode(filp); in locks_check_ctx_file_list()
315 if (fl->fl_file == filp) in locks_check_ctx_file_list()
479 flock_make_lock(struct file *filp, unsigned int cmd, struct file_lock *fl) in flock_make_lock() argument
494 fl->fl_file = filp; in flock_make_lock()
495 fl->fl_owner = filp; in flock_make_lock()
518 static int flock64_to_posix_lock(struct file *filp, struct file_lock *fl, in flock64_to_posix_lock() argument
526 fl->fl_start = filp->f_pos; in flock64_to_posix_lock()
529 fl->fl_start = i_size_read(file_inode(filp)); in flock64_to_posix_lock()
557 fl->fl_file = filp; in flock64_to_posix_lock()
[all …]
Dpipe.c275 struct file *filp = iocb->ki_filp; in pipe_read() local
276 struct pipe_inode_info *pipe = filp->private_data; in pipe_read()
345 if (filp->f_flags & O_NONBLOCK) { in pipe_read()
369 file_accessed(filp); in pipe_read()
381 struct file *filp = iocb->ki_filp; in pipe_write() local
382 struct pipe_inode_info *pipe = filp->private_data; in pipe_write()
469 if (is_packetized(filp)) { in pipe_write()
481 if (filp->f_flags & O_NONBLOCK) { in pipe_write()
506 if (ret > 0 && sb_start_write_trylock(file_inode(filp)->i_sb)) { in pipe_write()
507 int err = file_update_time(filp); in pipe_write()
[all …]
Dopen.c39 unsigned int time_attrs, struct file *filp) in do_truncate2() argument
50 if (filp) { in do_truncate2()
51 newattrs.ia_file = filp; in do_truncate2()
69 struct file *filp) in do_truncate() argument
71 return do_truncate2(NULL, dentry, length, time_attrs, filp); in do_truncate()
911 char *file_path(struct file *filp, char *buf, int buflen) in file_path() argument
913 return d_path(&filp->f_path, buf, buflen); in file_path()
1176 int filp_close(struct file *filp, fl_owner_t id) in filp_close() argument
1180 if (!file_count(filp)) { in filp_close()
1185 if (filp->f_op->flush) in filp_close()
[all …]
/fs/nfs/
Dfile.c65 nfs_file_open(struct inode *inode, struct file *filp) in nfs_file_open() argument
69 dprintk("NFS: open file(%pD2)\n", filp); in nfs_file_open()
72 res = nfs_check_flags(filp->f_flags); in nfs_file_open()
76 res = nfs_open(inode, filp); in nfs_file_open()
81 nfs_file_release(struct inode *inode, struct file *filp) in nfs_file_release() argument
83 dprintk("NFS: release(%pD2)\n", filp); in nfs_file_release()
86 nfs_file_clear_open_context(filp); in nfs_file_release()
102 static int nfs_revalidate_file_size(struct inode *inode, struct file *filp) in nfs_revalidate_file_size() argument
106 if (filp->f_flags & O_DIRECT) in nfs_revalidate_file_size()
115 loff_t nfs_file_llseek(struct file *filp, loff_t offset, int whence) in nfs_file_llseek() argument
[all …]
Dnfs4file.c26 nfs4_file_open(struct inode *inode, struct file *filp) in nfs4_file_open() argument
29 struct dentry *dentry = file_dentry(filp); in nfs4_file_open()
32 unsigned openflags = filp->f_flags; in nfs4_file_open()
52 return nfs_open(inode, filp); in nfs4_file_open()
60 ctx = alloc_nfs_open_context(file_dentry(filp), filp->f_mode, filp); in nfs4_file_open()
90 nfs_file_set_open_context(filp, ctx); in nfs4_file_open()
91 nfs_fscache_open_file(inode, filp); in nfs4_file_open()
/fs/9p/
Dvfs_file.c116 static int v9fs_file_lock(struct file *filp, int cmd, struct file_lock *fl) in v9fs_file_lock() argument
119 struct inode *inode = file_inode(filp); in v9fs_file_lock()
121 p9_debug(P9_DEBUG_VFS, "filp: %p lock: %p\n", filp, fl); in v9fs_file_lock()
135 static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl) in v9fs_file_do_lock() argument
144 fid = filp->private_data; in v9fs_file_do_lock()
150 res = locks_lock_file_wait(filp, fl); in v9fs_file_do_lock()
178 v9ses = v9fs_inode2v9ses(file_inode(filp)); in v9fs_file_do_lock()
232 locks_lock_file_wait(filp, fl); in v9fs_file_do_lock()
241 static int v9fs_file_getlock(struct file *filp, struct file_lock *fl) in v9fs_file_getlock() argument
247 fid = filp->private_data; in v9fs_file_getlock()
[all …]
Dvfs_addr.c83 static int v9fs_vfs_readpage(struct file *filp, struct page *page) in v9fs_vfs_readpage() argument
85 return v9fs_fid_readpage(filp->private_data, page); in v9fs_vfs_readpage()
98 static int v9fs_vfs_readpages(struct file *filp, struct address_space *mapping, in v9fs_vfs_readpages() argument
105 p9_debug(P9_DEBUG_VFS, "inode: %p file: %p\n", inode, filp); in v9fs_vfs_readpages()
112 filp->private_data); in v9fs_vfs_readpages()
255 static int v9fs_write_begin(struct file *filp, struct address_space *mapping, in v9fs_write_begin() argument
266 p9_debug(P9_DEBUG_VFS, "filp %p, mapping %p\n", filp, mapping); in v9fs_write_begin()
291 static int v9fs_write_end(struct file *filp, struct address_space *mapping, in v9fs_write_end() argument
298 p9_debug(P9_DEBUG_VFS, "filp %p, mapping %p\n", filp, mapping); in v9fs_write_end()
/fs/f2fs/
Dfile.c498 static int f2fs_file_open(struct inode *inode, struct file *filp) in f2fs_file_open() argument
500 int err = fscrypt_file_open(inode, filp); in f2fs_file_open()
505 err = fsverity_file_open(inode, filp); in f2fs_file_open()
509 filp->f_mode |= FMODE_NOWAIT; in f2fs_file_open()
511 return dquot_file_open(inode, filp); in f2fs_file_open()
1668 static int f2fs_release_file(struct inode *inode, struct file *filp) in f2fs_release_file() argument
1674 if (!(filp->f_mode & FMODE_WRITE) || in f2fs_release_file()
1810 static int f2fs_ioc_getflags(struct file *filp, unsigned long arg) in f2fs_ioc_getflags() argument
1812 struct inode *inode = file_inode(filp); in f2fs_ioc_getflags()
1830 static int f2fs_ioc_setflags(struct file *filp, unsigned long arg) in f2fs_ioc_setflags() argument
[all …]
/fs/debugfs/
Dfile.c47 #define F_DENTRY(filp) ((filp)->f_path.dentry) argument
49 const struct file_operations *debugfs_real_fops(const struct file *filp) in debugfs_real_fops() argument
51 struct debugfs_fsdata *fsd = F_DENTRY(filp)->d_fsdata; in debugfs_real_fops()
146 struct file *filp, in debugfs_locked_down() argument
150 !(filp->f_mode & FMODE_WRITE) && in debugfs_locked_down()
162 static int open_proxy_open(struct inode *inode, struct file *filp) in open_proxy_open() argument
164 struct dentry *dentry = F_DENTRY(filp); in open_proxy_open()
172 real_fops = debugfs_real_fops(filp); in open_proxy_open()
174 r = debugfs_locked_down(inode, filp, real_fops); in open_proxy_open()
186 replace_fops(filp, real_fops); in open_proxy_open()
[all …]
/fs/nilfs2/
Dioctl.c128 static int nilfs_ioctl_setflags(struct inode *inode, struct file *filp, in nilfs_ioctl_setflags() argument
141 ret = mnt_want_write_file(filp); in nilfs_ioctl_setflags()
171 mnt_drop_write_file(filp); in nilfs_ioctl_setflags()
202 static int nilfs_ioctl_change_cpmode(struct inode *inode, struct file *filp, in nilfs_ioctl_change_cpmode() argument
213 ret = mnt_want_write_file(filp); in nilfs_ioctl_change_cpmode()
233 mnt_drop_write_file(filp); in nilfs_ioctl_change_cpmode()
257 nilfs_ioctl_delete_checkpoint(struct inode *inode, struct file *filp, in nilfs_ioctl_delete_checkpoint() argument
268 ret = mnt_want_write_file(filp); in nilfs_ioctl_delete_checkpoint()
283 mnt_drop_write_file(filp); in nilfs_ioctl_delete_checkpoint()
336 static int nilfs_ioctl_get_cpstat(struct inode *inode, struct file *filp, in nilfs_ioctl_get_cpstat() argument
[all …]
/fs/ext4/
Dioctl.c431 static int ext4_ioctl_setproject(struct file *filp, __u32 projid) in ext4_ioctl_setproject() argument
433 struct inode *inode = file_inode(filp); in ext4_ioctl_setproject()
517 static int ext4_ioctl_setproject(struct file *filp, __u32 projid) in ext4_ioctl_setproject() argument
774 static int ext4_ioctl_get_es_cache(struct file *filp, unsigned long arg) in ext4_ioctl_get_es_cache() argument
779 struct inode *inode = file_inode(filp); in ext4_ioctl_get_es_cache()
816 long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) in ext4_ioctl() argument
818 struct inode *inode = file_inode(filp); in ext4_ioctl()
854 err = mnt_want_write_file(filp); in ext4_ioctl()
865 mnt_drop_write_file(filp); in ext4_ioctl()
887 err = mnt_want_write_file(filp); in ext4_ioctl()
[all …]
Ddir.c67 struct inode *dir, struct file *filp, in __ext4_check_dir_entry() argument
95 if (filp) in __ext4_check_dir_entry()
96 ext4_error_file(filp, function, line, bh->b_blocknr, in __ext4_check_dir_entry()
316 static inline loff_t hash2pos(struct file *filp, __u32 major, __u32 minor) in hash2pos() argument
318 if ((filp->f_mode & FMODE_32BITHASH) || in hash2pos()
319 (!(filp->f_mode & FMODE_64BITHASH) && is_32bit_api())) in hash2pos()
325 static inline __u32 pos2maj_hash(struct file *filp, loff_t pos) in pos2maj_hash() argument
327 if ((filp->f_mode & FMODE_32BITHASH) || in pos2maj_hash()
328 (!(filp->f_mode & FMODE_64BITHASH) && is_32bit_api())) in pos2maj_hash()
334 static inline __u32 pos2min_hash(struct file *filp, loff_t pos) in pos2min_hash() argument
[all …]
Dfile.c85 static int ext4_release_file(struct inode *inode, struct file *filp) in ext4_release_file() argument
92 if ((filp->f_mode & FMODE_WRITE) && in ext4_release_file()
100 if (is_dx(inode) && filp->private_data) in ext4_release_file()
101 ext4_htree_free_dir_info(filp->private_data); in ext4_release_file()
443 static int ext4_file_open(struct inode * inode, struct file * filp) in ext4_file_open() argument
450 ret = ext4_sample_last_mounted(inode->i_sb, filp->f_path.mnt); in ext4_file_open()
454 ret = fscrypt_file_open(inode, filp); in ext4_file_open()
458 ret = fsverity_file_open(inode, filp); in ext4_file_open()
466 if (filp->f_mode & FMODE_WRITE) { in ext4_file_open()
472 filp->f_mode |= FMODE_NOWAIT; in ext4_file_open()
[all …]
/fs/notify/dnotify/
Ddnotify.c141 void dnotify_flush(struct file *filp, fl_owner_t id) in dnotify_flush() argument
150 inode = file_inode(filp); in dnotify_flush()
164 if ((dn->dn_owner == id) && (dn->dn_filp == filp)) { in dnotify_flush()
219 fl_owner_t id, int fd, struct file *filp, __u32 mask) in attach_dn() argument
226 if ((odn->dn_owner == id) && (odn->dn_filp == filp)) { in attach_dn()
236 dn->dn_filp = filp; in attach_dn()
249 int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg) in fcntl_dirnotify() argument
271 dnotify_flush(filp, id); in fcntl_dirnotify()
277 inode = file_inode(filp); in fcntl_dirnotify()
289 error = security_path_notify(&filp->f_path, mask, in fcntl_dirnotify()
[all …]
/fs/reiserfs/
Dioctl.c23 long reiserfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) in reiserfs_ioctl() argument
25 struct inode *inode = file_inode(filp); in reiserfs_ioctl()
35 err = reiserfs_unpack(inode, filp); in reiserfs_ioctl()
58 err = mnt_want_write_file(filp); in reiserfs_ioctl()
86 result = reiserfs_unpack(inode, filp); in reiserfs_ioctl()
97 mnt_drop_write_file(filp); in reiserfs_ioctl()
108 err = mnt_want_write_file(filp); in reiserfs_ioctl()
118 mnt_drop_write_file(filp); in reiserfs_ioctl()
168 int reiserfs_unpack(struct inode *inode, struct file *filp) in reiserfs_unpack() argument
/fs/verity/
Denable.c157 static int enable_verity(struct file *filp, in enable_verity() argument
160 struct inode *inode = file_inode(filp); in enable_verity()
214 err = vops->begin_enable_verity(filp); in enable_verity()
260 err = vops->end_enable_verity(filp, desc, desc_size, params.tree_size); in enable_verity()
286 (void)vops->end_enable_verity(filp, NULL, 0, params.tree_size); in enable_verity()
299 int fsverity_ioctl_enable(struct file *filp, const void __user *uarg) in fsverity_ioctl_enable() argument
301 struct inode *inode = file_inode(filp); in fsverity_ioctl_enable()
344 err = mnt_want_write_file(filp); in fsverity_ioctl_enable()
348 err = deny_write_access(filp); in fsverity_ioctl_enable()
352 err = enable_verity(filp, &arg); in fsverity_ioctl_enable()
[all …]
/fs/ext2/
Dioctl.c21 long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) in ext2_ioctl() argument
23 struct inode *inode = file_inode(filp); in ext2_ioctl()
38 ret = mnt_want_write_file(filp); in ext2_ioctl()
79 mnt_drop_write_file(filp); in ext2_ioctl()
89 ret = mnt_want_write_file(filp); in ext2_ioctl()
104 mnt_drop_write_file(filp); in ext2_ioctl()
126 ret = mnt_want_write_file(filp); in ext2_ioctl()
150 mnt_drop_write_file(filp); in ext2_ioctl()
/fs/xfs/
Dxfs_ioctl.c188 struct file *filp; in xfs_open_by_handle() local
239 filp = dentry_open(&path, hreq->oflags, cred); in xfs_open_by_handle()
241 if (IS_ERR(filp)) { in xfs_open_by_handle()
243 return PTR_ERR(filp); in xfs_open_by_handle()
247 filp->f_flags |= O_NOATIME; in xfs_open_by_handle()
248 filp->f_mode |= FMODE_NOCMTIME; in xfs_open_by_handle()
251 fd_install(fd, filp); in xfs_open_by_handle()
590 struct file *filp, in xfs_ioc_space() argument
594 struct inode *inode = file_inode(filp); in xfs_ioc_space()
604 if (!(filp->f_mode & FMODE_WRITE)) in xfs_ioc_space()
[all …]
Dxfs_ioctl32.c543 struct file *filp, in xfs_file_compat_ioctl() argument
547 struct inode *inode = file_inode(filp); in xfs_file_compat_ioctl()
571 return xfs_ioc_space(filp, cmd, &bf); in xfs_file_compat_ioctl()
580 error = mnt_want_write_file(filp); in xfs_file_compat_ioctl()
584 mnt_drop_write_file(filp); in xfs_file_compat_ioctl()
592 error = mnt_want_write_file(filp); in xfs_file_compat_ioctl()
596 mnt_drop_write_file(filp); in xfs_file_compat_ioctl()
605 return xfs_file_ioctl(filp, cmd, p); in xfs_file_compat_ioctl()
615 error = mnt_want_write_file(filp); in xfs_file_compat_ioctl()
619 mnt_drop_write_file(filp); in xfs_file_compat_ioctl()
[all …]
/fs/jfs/
Dioctl.c60 long jfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) in jfs_ioctl() argument
62 struct inode *inode = file_inode(filp); in jfs_ioctl()
75 err = mnt_want_write_file(filp); in jfs_ioctl()
118 mnt_drop_write_file(filp); in jfs_ioctl()
161 long jfs_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) in jfs_compat_ioctl() argument
175 return jfs_ioctl(filp, cmd, arg); in jfs_compat_ioctl()
/fs/nfsd/
Dlockd.c28 nlm_fopen(struct svc_rqst *rqstp, struct nfs_fh *f, struct file **filp) in nlm_fopen() argument
39 nfserr = nfsd_open(rqstp, &fh, S_IFREG, NFSD_MAY_LOCK, filp); in nlm_fopen()
57 nlm_fclose(struct file *filp) in nlm_fclose() argument
59 fput(filp); in nlm_fclose()
/fs/jffs2/
Dfile.c24 static int jffs2_write_end(struct file *filp, struct address_space *mapping,
27 static int jffs2_write_begin(struct file *filp, struct address_space *mapping,
30 static int jffs2_readpage (struct file *filp, struct page *pg);
32 int jffs2_fsync(struct file *filp, loff_t start, loff_t end, int datasync) in jffs2_fsync() argument
34 struct inode *inode = filp->f_mapping->host; in jffs2_fsync()
38 ret = file_write_and_wait_range(filp, start, end); in jffs2_fsync()
120 static int jffs2_readpage (struct file *filp, struct page *pg) in jffs2_readpage() argument
131 static int jffs2_write_begin(struct file *filp, struct address_space *mapping, in jffs2_write_begin() argument
235 static int jffs2_write_end(struct file *filp, struct address_space *mapping, in jffs2_write_end() argument
/fs/crypto/
Dpolicy.c312 int fscrypt_ioctl_set_policy(struct file *filp, const void __user *arg) in fscrypt_ioctl_set_policy() argument
316 struct inode *inode = file_inode(filp); in fscrypt_ioctl_set_policy()
347 ret = mnt_want_write_file(filp); in fscrypt_ioctl_set_policy()
372 mnt_drop_write_file(filp); in fscrypt_ioctl_set_policy()
378 int fscrypt_ioctl_get_policy(struct file *filp, void __user *arg) in fscrypt_ioctl_get_policy() argument
383 err = fscrypt_get_policy(file_inode(filp), &policy); in fscrypt_ioctl_get_policy()
397 int fscrypt_ioctl_get_policy_ex(struct file *filp, void __user *uarg) in fscrypt_ioctl_get_policy_ex() argument
410 err = fscrypt_get_policy(file_inode(filp), policy); in fscrypt_ioctl_get_policy_ex()

12345