Home
last modified time | relevance | path

Searched refs:filp (Results 1 – 25 of 121) 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 …]
Dlocks.c142 static inline bool is_remote_lock(struct file *filp) in is_remote_lock() argument
144 return likely(!(filp->f_path.dentry->d_sb->s_flags & MS_NOREMOTELOCK)); in is_remote_lock()
275 locks_check_ctx_file_list(struct file *filp, struct list_head *list, in locks_check_ctx_file_list() argument
279 struct inode *inode = locks_inode(filp); in locks_check_ctx_file_list()
282 if (fl->fl_file == filp) in locks_check_ctx_file_list()
428 flock_make_lock(struct file *filp, unsigned int cmd) in flock_make_lock() argument
440 fl->fl_file = filp; in flock_make_lock()
441 fl->fl_owner = filp; in flock_make_lock()
464 static int flock64_to_posix_lock(struct file *filp, struct file_lock *fl, in flock64_to_posix_lock() argument
472 fl->fl_start = filp->f_pos; in flock64_to_posix_lock()
[all …]
Dioctl.c39 long vfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) in vfs_ioctl() argument
43 if (!filp->f_op->unlocked_ioctl) in vfs_ioctl()
46 error = filp->f_op->unlocked_ioctl(filp, cmd, arg); in vfs_ioctl()
53 static int ioctl_fibmap(struct file *filp, int __user *p) in ioctl_fibmap() argument
55 struct address_space *mapping = filp->f_mapping; in ioctl_fibmap()
176 static int ioctl_fiemap(struct file *filp, unsigned long arg) in ioctl_fiemap() argument
181 struct inode *inode = file_inode(filp); in ioctl_fiemap()
460 int ioctl_preallocate(struct file *filp, void __user *argp) in ioctl_preallocate() argument
462 struct inode *inode = file_inode(filp); in ioctl_preallocate()
472 sr.l_start += filp->f_pos; in ioctl_preallocate()
[all …]
Dpipe.c268 struct file *filp = iocb->ki_filp; in pipe_read() local
269 struct pipe_inode_info *pipe = filp->private_data; in pipe_read()
338 if (filp->f_flags & O_NONBLOCK) { in pipe_read()
362 file_accessed(filp); in pipe_read()
374 struct file *filp = iocb->ki_filp; in pipe_write() local
375 struct pipe_inode_info *pipe = filp->private_data; in pipe_write()
462 if (is_packetized(filp)) { in pipe_write()
474 if (filp->f_flags & O_NONBLOCK) { in pipe_write()
499 if (ret > 0 && sb_start_write_trylock(file_inode(filp)->i_sb)) { in pipe_write()
500 int err = file_update_time(filp); in pipe_write()
[all …]
Dopen.c38 unsigned int time_attrs, struct file *filp) in do_truncate2() argument
49 if (filp) { in do_truncate2()
50 newattrs.ia_file = filp; in do_truncate2()
68 struct file *filp) in do_truncate() argument
70 return do_truncate2(NULL, dentry, length, time_attrs, filp); in do_truncate()
879 char *file_path(struct file *filp, char *buf, int buflen) in file_path() argument
881 return d_path(&filp->f_path, buf, buflen); in file_path()
1160 int filp_close(struct file *filp, fl_owner_t id) in filp_close() argument
1164 if (!file_count(filp)) { in filp_close()
1169 if (filp->f_op->flush) in filp_close()
[all …]
/fs/nfs/
Dfile.c64 nfs_file_open(struct inode *inode, struct file *filp) in nfs_file_open() argument
68 dprintk("NFS: open file(%pD2)\n", filp); in nfs_file_open()
71 res = nfs_check_flags(filp->f_flags); in nfs_file_open()
75 res = nfs_open(inode, filp); in nfs_file_open()
80 nfs_file_release(struct inode *inode, struct file *filp) in nfs_file_release() argument
82 dprintk("NFS: release(%pD2)\n", filp); in nfs_file_release()
85 nfs_file_clear_open_context(filp); in nfs_file_release()
101 static int nfs_revalidate_file_size(struct inode *inode, struct file *filp) in nfs_revalidate_file_size() argument
105 if (filp->f_flags & O_DIRECT) in nfs_revalidate_file_size()
114 loff_t nfs_file_llseek(struct file *filp, loff_t offset, int whence) in nfs_file_llseek() argument
[all …]
Dnfs4file.c27 nfs4_file_open(struct inode *inode, struct file *filp) in nfs4_file_open() argument
30 struct dentry *dentry = file_dentry(filp); in nfs4_file_open()
33 unsigned openflags = filp->f_flags; in nfs4_file_open()
53 return nfs_open(inode, filp); in nfs4_file_open()
61 ctx = alloc_nfs_open_context(file_dentry(filp), filp->f_mode, filp); in nfs4_file_open()
91 nfs_file_set_open_context(filp, ctx); in nfs4_file_open()
92 nfs_fscache_open_file(inode, filp); in nfs4_file_open()
/fs/9p/
Dvfs_file.c131 static int v9fs_file_lock(struct file *filp, int cmd, struct file_lock *fl) in v9fs_file_lock() argument
134 struct inode *inode = file_inode(filp); in v9fs_file_lock()
136 p9_debug(P9_DEBUG_VFS, "filp: %p lock: %p\n", filp, fl); in v9fs_file_lock()
150 static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl) in v9fs_file_do_lock() argument
159 fid = filp->private_data; in v9fs_file_do_lock()
165 res = locks_lock_file_wait(filp, fl); in v9fs_file_do_lock()
193 v9ses = v9fs_inode2v9ses(file_inode(filp)); in v9fs_file_do_lock()
247 locks_lock_file_wait(filp, fl); in v9fs_file_do_lock()
256 static int v9fs_file_getlock(struct file *filp, struct file_lock *fl) in v9fs_file_getlock() argument
262 fid = filp->private_data; in v9fs_file_getlock()
[all …]
Dvfs_addr.c98 static int v9fs_vfs_readpage(struct file *filp, struct page *page) in v9fs_vfs_readpage() argument
100 return v9fs_fid_readpage(filp->private_data, page); in v9fs_vfs_readpage()
113 static int v9fs_vfs_readpages(struct file *filp, struct address_space *mapping, in v9fs_vfs_readpages() argument
120 p9_debug(P9_DEBUG_VFS, "inode: %p file: %p\n", inode, filp); in v9fs_vfs_readpages()
127 filp->private_data); in v9fs_vfs_readpages()
270 static int v9fs_write_begin(struct file *filp, struct address_space *mapping, in v9fs_write_begin() argument
281 p9_debug(P9_DEBUG_VFS, "filp %p, mapping %p\n", filp, mapping); in v9fs_write_begin()
306 static int v9fs_write_end(struct file *filp, struct address_space *mapping, in v9fs_write_end() argument
313 p9_debug(P9_DEBUG_VFS, "filp %p, mapping %p\n", filp, mapping); in v9fs_write_end()
/fs/f2fs/
Dfile.c490 static int f2fs_file_open(struct inode *inode, struct file *filp) in f2fs_file_open() argument
492 int err = fscrypt_file_open(inode, filp); in f2fs_file_open()
497 filp->f_mode |= FMODE_NOWAIT; in f2fs_file_open()
499 return dquot_file_open(inode, filp); in f2fs_file_open()
1600 static int f2fs_release_file(struct inode *inode, struct file *filp) in f2fs_release_file() argument
1606 if (!(filp->f_mode & FMODE_WRITE) || in f2fs_release_file()
1639 static int f2fs_ioc_getflags(struct file *filp, unsigned long arg) in f2fs_ioc_getflags() argument
1641 struct inode *inode = file_inode(filp); in f2fs_ioc_getflags()
1689 static int f2fs_ioc_setflags(struct file *filp, unsigned long arg) in f2fs_ioc_setflags() argument
1691 struct inode *inode = file_inode(filp); in f2fs_ioc_setflags()
[all …]
/fs/debugfs/
Dfile.c98 #define F_DENTRY(filp) ((filp)->f_path.dentry) argument
100 static int open_proxy_open(struct inode *inode, struct file *filp) in open_proxy_open() argument
102 const struct dentry *dentry = F_DENTRY(filp); in open_proxy_open()
112 real_fops = debugfs_real_fops(filp); in open_proxy_open()
121 replace_fops(filp, real_fops); in open_proxy_open()
124 r = real_fops->open(inode, filp); in open_proxy_open()
138 #define FULL_PROXY_FUNC(name, ret_type, filp, proto, args) \ argument
141 const struct dentry *dentry = F_DENTRY(filp); \
143 debugfs_real_fops(filp); \
154 FULL_PROXY_FUNC(llseek, loff_t, filp,
[all …]
/fs/nilfs2/
Dioctl.c137 static int nilfs_ioctl_setflags(struct inode *inode, struct file *filp, in nilfs_ioctl_setflags() argument
150 ret = mnt_want_write_file(filp); in nilfs_ioctl_setflags()
185 mnt_drop_write_file(filp); in nilfs_ioctl_setflags()
216 static int nilfs_ioctl_change_cpmode(struct inode *inode, struct file *filp, in nilfs_ioctl_change_cpmode() argument
227 ret = mnt_want_write_file(filp); in nilfs_ioctl_change_cpmode()
247 mnt_drop_write_file(filp); in nilfs_ioctl_change_cpmode()
271 nilfs_ioctl_delete_checkpoint(struct inode *inode, struct file *filp, in nilfs_ioctl_delete_checkpoint() argument
282 ret = mnt_want_write_file(filp); in nilfs_ioctl_delete_checkpoint()
297 mnt_drop_write_file(filp); in nilfs_ioctl_delete_checkpoint()
350 static int nilfs_ioctl_get_cpstat(struct inode *inode, struct file *filp, in nilfs_ioctl_get_cpstat() argument
[all …]
/fs/ext4/
Ddir.c62 struct inode *dir, struct file *filp, in __ext4_check_dir_entry() argument
90 if (filp) in __ext4_check_dir_entry()
91 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 …]
Dioctl.c361 static int ext4_ioctl_setproject(struct file *filp, __u32 projid) in ext4_ioctl_setproject() argument
363 struct inode *inode = file_inode(filp); in ext4_ioctl_setproject()
447 static int ext4_ioctl_setproject(struct file *filp, __u32 projid) in ext4_ioctl_setproject() argument
652 long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) in ext4_ioctl() argument
654 struct inode *inode = file_inode(filp); in ext4_ioctl()
688 err = mnt_want_write_file(filp); in ext4_ioctl()
699 mnt_drop_write_file(filp); in ext4_ioctl()
721 err = mnt_want_write_file(filp); in ext4_ioctl()
746 mnt_drop_write_file(filp); in ext4_ioctl()
769 err = mnt_want_write_file(filp); in ext4_ioctl()
[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()
88 result = reiserfs_unpack(inode, filp); in reiserfs_ioctl()
99 mnt_drop_write_file(filp); in reiserfs_ioctl()
110 err = mnt_want_write_file(filp); in reiserfs_ioctl()
120 mnt_drop_write_file(filp); in reiserfs_ioctl()
170 int reiserfs_unpack(struct inode *inode, struct file *filp) in reiserfs_unpack() argument
/fs/notify/dnotify/
Ddnotify.c148 void dnotify_flush(struct file *filp, fl_owner_t id) in dnotify_flush() argument
157 inode = file_inode(filp); in dnotify_flush()
171 if ((dn->dn_owner == id) && (dn->dn_filp == filp)) { in dnotify_flush()
226 fl_owner_t id, int fd, struct file *filp, __u32 mask) in attach_dn() argument
233 if ((odn->dn_owner == id) && (odn->dn_filp == filp)) { in attach_dn()
243 dn->dn_filp = filp; in attach_dn()
256 int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg) in fcntl_dirnotify() argument
278 dnotify_flush(filp, id); in fcntl_dirnotify()
284 inode = file_inode(filp); in fcntl_dirnotify()
343 if (f != filp) { in fcntl_dirnotify()
[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()
87 mnt_drop_write_file(filp); in ext2_ioctl()
97 ret = mnt_want_write_file(filp); in ext2_ioctl()
112 mnt_drop_write_file(filp); in ext2_ioctl()
134 ret = mnt_want_write_file(filp); in ext2_ioctl()
158 mnt_drop_write_file(filp); in ext2_ioctl()
/fs/xfs/
Dxfs_ioctl.c205 struct file *filp; in xfs_open_by_handle() local
256 filp = dentry_open(&path, hreq->oflags, cred); in xfs_open_by_handle()
258 if (IS_ERR(filp)) { in xfs_open_by_handle()
260 return PTR_ERR(filp); in xfs_open_by_handle()
264 filp->f_flags |= O_NOATIME; in xfs_open_by_handle()
265 filp->f_mode |= FMODE_NOCMTIME; in xfs_open_by_handle()
268 fd_install(fd, filp); in xfs_open_by_handle()
607 struct file *filp, in xfs_ioc_space() argument
611 struct inode *inode = file_inode(filp); in xfs_ioc_space()
629 if (!(filp->f_mode & FMODE_WRITE)) in xfs_ioc_space()
[all …]
Dxfs_ioctl32.c560 struct file *filp, in xfs_file_compat_ioctl() argument
564 struct inode *inode = file_inode(filp); in xfs_file_compat_ioctl()
591 return xfs_file_ioctl(filp, cmd, p); in xfs_file_compat_ioctl()
606 return xfs_file_ioctl(filp, cmd, p); in xfs_file_compat_ioctl()
622 return xfs_ioc_space(filp, cmd, &bf); in xfs_file_compat_ioctl()
631 error = mnt_want_write_file(filp); in xfs_file_compat_ioctl()
635 mnt_drop_write_file(filp); in xfs_file_compat_ioctl()
643 error = mnt_want_write_file(filp); in xfs_file_compat_ioctl()
647 mnt_drop_write_file(filp); in xfs_file_compat_ioctl()
656 return xfs_file_ioctl(filp, cmd, p); in xfs_file_compat_ioctl()
[all …]
/fs/exofs/
Dfile.c35 static int exofs_release_file(struct inode *inode, struct file *filp) in exofs_release_file() argument
45 static int exofs_file_fsync(struct file *filp, loff_t start, loff_t end, in exofs_file_fsync() argument
48 struct inode *inode = filp->f_mapping->host; in exofs_file_fsync()
51 ret = file_write_and_wait_range(filp, start, end); in exofs_file_fsync()
56 ret = sync_inode_metadata(filp->f_mapping->host, 1); in exofs_file_fsync()
/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()
126 mnt_drop_write_file(filp); in jfs_ioctl()
169 long jfs_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) in jfs_compat_ioctl() argument
183 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.c58 int fscrypt_ioctl_set_policy(struct file *filp, const void __user *arg) in fscrypt_ioctl_set_policy() argument
61 struct inode *inode = file_inode(filp); in fscrypt_ioctl_set_policy()
74 ret = mnt_want_write_file(filp); in fscrypt_ioctl_set_policy()
103 mnt_drop_write_file(filp); in fscrypt_ioctl_set_policy()
108 int fscrypt_ioctl_get_policy(struct file *filp, void __user *arg) in fscrypt_ioctl_get_policy() argument
110 struct inode *inode = file_inode(filp); in fscrypt_ioctl_get_policy()
/fs/fat/
Dfile.c124 long fat_generic_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) in fat_generic_ioctl() argument
126 struct inode *inode = file_inode(filp); in fat_generic_ioctl()
133 return fat_ioctl_set_attributes(filp, user_attr); in fat_generic_ioctl()
142 static long fat_generic_compat_ioctl(struct file *filp, unsigned int cmd, in fat_generic_compat_ioctl() argument
146 return fat_generic_ioctl(filp, cmd, (unsigned long)compat_ptr(arg)); in fat_generic_compat_ioctl()
150 static int fat_file_release(struct inode *inode, struct file *filp) in fat_file_release() argument
152 if ((filp->f_mode & FMODE_WRITE) && in fat_file_release()
160 int fat_file_fsync(struct file *filp, loff_t start, loff_t end, int datasync) in fat_file_fsync() argument
162 struct inode *inode = filp->f_mapping->host; in fat_file_fsync()
165 err = __generic_file_fsync(filp, start, end, datasync); in fat_file_fsync()

12345