/fs/ |
D | fcntl.c | 36 static int setfl(int fd, struct file * filp, unsigned long arg) in setfl() argument 38 struct inode * inode = file_inode(filp); in setfl() 45 if (((arg ^ filp->f_flags) & O_APPEND) && IS_APPEND(inode)) in setfl() 49 if ((arg & O_NOATIME) && !(filp->f_flags & O_NOATIME)) in setfl() 50 if (!inode_owner_or_capable(file_mnt_user_ns(filp), inode)) in setfl() 60 if (!filp->f_mapping || !filp->f_mapping->a_ops || in setfl() 61 !filp->f_mapping->a_ops->direct_IO) in setfl() 65 if (filp->f_op->check_flags) in setfl() 66 error = filp->f_op->check_flags(arg); in setfl() 73 if (((arg ^ filp->f_flags) & FASYNC) && filp->f_op->fasync) { in setfl() [all …]
|
D | locks.c | 308 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 …]
|
D | ioctl.c | 44 long vfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) in vfs_ioctl() argument 48 if (!filp->f_op->unlocked_ioctl) in vfs_ioctl() 51 error = filp->f_op->unlocked_ioctl(filp, cmd, arg); in vfs_ioctl() 59 static int ioctl_fibmap(struct file *filp, int __user *p) in ioctl_fibmap() argument 61 struct inode *inode = file_inode(filp); in ioctl_fibmap() 83 sb->s_id, filp); in ioctl_fibmap() 199 static int ioctl_fiemap(struct file *filp, struct fiemap __user *ufiemap) in ioctl_fiemap() argument 203 struct inode *inode = file_inode(filp); in ioctl_fiemap() 273 static int ioctl_preallocate(struct file *filp, int mode, void __user *argp) in ioctl_preallocate() argument 275 struct inode *inode = file_inode(filp); in ioctl_preallocate() [all …]
|
D | pipe.c | 233 struct file *filp = iocb->ki_filp; in pipe_read() local 234 struct pipe_inode_info *pipe = filp->private_data; in pipe_read() 344 if (filp->f_flags & O_NONBLOCK) { in pipe_read() 394 file_accessed(filp); in pipe_read() 417 struct file *filp = iocb->ki_filp; in pipe_write() local 418 struct pipe_inode_info *pipe = filp->private_data; in pipe_write() 523 if (is_packetized(filp)) in pipe_write() 547 if (filp->f_flags & O_NONBLOCK) { in pipe_write() 595 if (ret > 0 && sb_start_write_trylock(file_inode(filp)->i_sb)) { in pipe_write() 596 int err = file_update_time(filp); in pipe_write() [all …]
|
D | open.c | 41 loff_t length, unsigned int time_attrs, struct file *filp) in do_truncate() argument 52 if (filp) { in do_truncate() 53 newattrs.ia_file = filp; in do_truncate() 943 char *file_path(struct file *filp, char *buf, int buflen) in file_path() argument 945 return d_path(&filp->f_path, buf, buflen); in file_path() 1332 int filp_close(struct file *filp, fl_owner_t id) in filp_close() argument 1336 if (!file_count(filp)) { in filp_close() 1341 if (filp->f_op->flush) in filp_close() 1342 retval = filp->f_op->flush(filp, id); in filp_close() 1344 if (likely(!(filp->f_mode & FMODE_PATH))) { in filp_close() [all …]
|
/fs/nfs/ |
D | file.c | 65 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 …]
|
/fs/9p/ |
D | vfs_file.c | 117 static int v9fs_file_lock(struct file *filp, int cmd, struct file_lock *fl) in v9fs_file_lock() argument 120 struct inode *inode = file_inode(filp); in v9fs_file_lock() 122 p9_debug(P9_DEBUG_VFS, "filp: %p lock: %p\n", filp, fl); in v9fs_file_lock() 132 static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl) in v9fs_file_do_lock() argument 141 fid = filp->private_data; in v9fs_file_do_lock() 147 res = locks_lock_file_wait(filp, fl); in v9fs_file_do_lock() 175 v9ses = v9fs_inode2v9ses(file_inode(filp)); in v9fs_file_do_lock() 229 locks_lock_file_wait(filp, fl); in v9fs_file_do_lock() 238 static int v9fs_file_getlock(struct file *filp, struct file_lock *fl) in v9fs_file_getlock() argument 244 fid = filp->private_data; in v9fs_file_getlock() [all …]
|
D | vfs_addr.c | 82 static int v9fs_vfs_readpage(struct file *filp, struct page *page) in v9fs_vfs_readpage() argument 84 return v9fs_fid_readpage(filp->private_data, page); in v9fs_vfs_readpage() 97 static int v9fs_vfs_readpages(struct file *filp, struct address_space *mapping, in v9fs_vfs_readpages() argument 104 p9_debug(P9_DEBUG_VFS, "inode: %p file: %p\n", inode, filp); in v9fs_vfs_readpages() 111 filp->private_data); in v9fs_vfs_readpages() 261 static int v9fs_write_begin(struct file *filp, struct address_space *mapping, in v9fs_write_begin() argument 272 p9_debug(P9_DEBUG_VFS, "filp %p, mapping %p\n", filp, mapping); in v9fs_write_begin() 297 static int v9fs_write_end(struct file *filp, struct address_space *mapping, in v9fs_write_end() argument 304 p9_debug(P9_DEBUG_VFS, "filp %p, mapping %p\n", filp, mapping); in v9fs_write_end()
|
/fs/incfs/ |
D | verity.c | 58 static int incfs_get_root_hash(struct file *filp, u8 *root_hash) in incfs_get_root_hash() argument 60 struct data_file *df = get_incfs_data_file(filp); in incfs_get_root_hash() 71 static int incfs_end_enable_verity(struct file *filp, u8 *sig, size_t sig_size) in incfs_end_enable_verity() argument 73 struct inode *inode = file_inode(filp); in incfs_end_enable_verity() 78 struct data_file *df = get_incfs_data_file(filp); in incfs_end_enable_verity() 254 struct file *filp, int hash_algorithm) in incfs_get_fsverity_descriptor() argument 256 struct inode *inode = file_inode(filp); in incfs_get_fsverity_descriptor() 270 err = incfs_get_root_hash(filp, desc->root_hash); in incfs_get_fsverity_descriptor() 280 struct inode *inode, struct file *filp, in incfs_calc_verity_digest() argument 284 struct fsverity_descriptor *desc = incfs_get_fsverity_descriptor(filp, in incfs_calc_verity_digest() [all …]
|
D | verity.h | 14 int incfs_ioctl_enable_verity(struct file *filp, const void __user *uarg); 15 int incfs_ioctl_measure_verity(struct file *filp, void __user *_uarg); 17 int incfs_fsverity_file_open(struct inode *inode, struct file *filp); 18 int incfs_ioctl_read_verity_metadata(struct file *filp, 23 static inline int incfs_ioctl_enable_verity(struct file *filp, in incfs_ioctl_enable_verity() argument 29 static inline int incfs_ioctl_measure_verity(struct file *filp, in incfs_ioctl_measure_verity() argument 36 struct file *filp) in incfs_fsverity_file_open() argument 41 static inline int incfs_ioctl_read_verity_metadata(struct file *filp, in incfs_ioctl_read_verity_metadata() argument
|
/fs/f2fs/ |
D | file.c | 536 static int f2fs_file_open(struct inode *inode, struct file *filp) in f2fs_file_open() argument 538 int err = fscrypt_file_open(inode, filp); in f2fs_file_open() 546 err = fsverity_file_open(inode, filp); in f2fs_file_open() 550 filp->f_mode |= FMODE_NOWAIT; in f2fs_file_open() 552 return dquot_file_open(inode, filp); in f2fs_file_open() 1845 static int f2fs_release_file(struct inode *inode, struct file *filp) in f2fs_release_file() argument 1851 if (!(filp->f_mode & FMODE_WRITE) || in f2fs_release_file() 2025 static int f2fs_ioc_getversion(struct file *filp, unsigned long arg) in f2fs_ioc_getversion() argument 2027 struct inode *inode = file_inode(filp); in f2fs_ioc_getversion() 2032 static int f2fs_ioc_start_atomic_write(struct file *filp, bool truncate) in f2fs_ioc_start_atomic_write() argument [all …]
|
/fs/debugfs/ |
D | file.c | 48 #define F_DENTRY(filp) ((filp)->f_path.dentry) argument 50 const struct file_operations *debugfs_real_fops(const struct file *filp) in debugfs_real_fops() argument 52 struct debugfs_fsdata *fsd = F_DENTRY(filp)->d_fsdata; in debugfs_real_fops() 155 struct file *filp, in debugfs_locked_down() argument 159 !(filp->f_mode & FMODE_WRITE) && in debugfs_locked_down() 171 static int open_proxy_open(struct inode *inode, struct file *filp) in open_proxy_open() argument 173 struct dentry *dentry = F_DENTRY(filp); in open_proxy_open() 181 real_fops = debugfs_real_fops(filp); in open_proxy_open() 183 r = debugfs_locked_down(inode, filp, real_fops); in open_proxy_open() 202 replace_fops(filp, real_fops); in open_proxy_open() [all …]
|
/fs/verity/ |
D | enable.c | 74 static int build_merkle_tree(struct file *filp, in build_merkle_tree() argument 78 struct inode *inode = file_inode(filp); in build_merkle_tree() 123 bytes_read = __kernel_read(filp, buffers[-1].data, in build_merkle_tree() 192 static int enable_verity(struct file *filp, in enable_verity() argument 195 struct inode *inode = file_inode(filp); in enable_verity() 247 err = vops->begin_enable_verity(filp); in enable_verity() 262 err = build_merkle_tree(filp, ¶ms, desc->root_hash); in enable_verity() 286 err = vops->end_enable_verity(filp, desc, desc_size, params.tree_size); in enable_verity() 312 (void)vops->end_enable_verity(filp, NULL, 0, params.tree_size); in enable_verity() 327 int fsverity_ioctl_enable(struct file *filp, const void __user *uarg) in fsverity_ioctl_enable() argument [all …]
|
/fs/ksmbd/ |
D | vfs.c | 293 v_len = ksmbd_vfs_getcasexattr(file_mnt_user_ns(fp->filp), in ksmbd_vfs_stream_read() 294 fp->filp->f_path.dentry, in ksmbd_vfs_stream_read() 325 static int check_lock_range(struct file *filp, loff_t start, loff_t end, in check_lock_range() argument 329 struct file_lock_context *ctx = file_inode(filp)->i_flctx; in check_lock_range() 347 if (flock->fl_file != filp) { in check_lock_range() 373 struct file *filp = fp->filp; in ksmbd_vfs_read() local 375 struct inode *inode = file_inode(filp); in ksmbd_vfs_read() 385 pr_err("no right to read(%pD)\n", fp->filp); in ksmbd_vfs_read() 396 ret = check_lock_range(filp, *pos, *pos + count - 1, READ); in ksmbd_vfs_read() 403 nbytes = kernel_read(filp, rbuf, count, pos); in ksmbd_vfs_read() [all …]
|
D | vfs_cache.c | 86 return __ksmbd_inode_lookup(fp->filp->f_path.dentry); in ksmbd_inode_lookup() 168 ci->m_de = fp->filp->f_path.dentry; in ksmbd_inode_init() 249 struct file *filp; in __ksmbd_inode_close() local 251 filp = fp->filp; in __ksmbd_inode_close() 254 err = ksmbd_vfs_remove_xattr(file_mnt_user_ns(filp), in __ksmbd_inode_close() 255 &filp->f_path, in __ksmbd_inode_close() 267 ksmbd_vfs_unlink(filp); in __ksmbd_inode_close() 302 struct file *filp; in __ksmbd_close_fd() local 310 filp = fp->filp; in __ksmbd_close_fd() 313 if (!IS_ERR_OR_NULL(filp)) in __ksmbd_close_fd() [all …]
|
/fs/nilfs2/ |
D | ioctl.c | 187 static int nilfs_ioctl_change_cpmode(struct inode *inode, struct file *filp, in nilfs_ioctl_change_cpmode() argument 198 ret = mnt_want_write_file(filp); in nilfs_ioctl_change_cpmode() 218 mnt_drop_write_file(filp); in nilfs_ioctl_change_cpmode() 242 nilfs_ioctl_delete_checkpoint(struct inode *inode, struct file *filp, in nilfs_ioctl_delete_checkpoint() argument 253 ret = mnt_want_write_file(filp); in nilfs_ioctl_delete_checkpoint() 268 mnt_drop_write_file(filp); in nilfs_ioctl_delete_checkpoint() 321 static int nilfs_ioctl_get_cpstat(struct inode *inode, struct file *filp, in nilfs_ioctl_get_cpstat() argument 388 static int nilfs_ioctl_get_sustat(struct inode *inode, struct file *filp, in nilfs_ioctl_get_sustat() argument 497 static int nilfs_ioctl_get_bdescs(struct inode *inode, struct file *filp, in nilfs_ioctl_get_bdescs() argument 843 static int nilfs_ioctl_clean_segments(struct inode *inode, struct file *filp, in nilfs_ioctl_clean_segments() argument [all …]
|
/fs/ext4/ |
D | ioctl.c | 776 static int ext4_ioctl_get_es_cache(struct file *filp, unsigned long arg) in ext4_ioctl_get_es_cache() argument 781 struct inode *inode = file_inode(filp); in ext4_ioctl_get_es_cache() 804 static int ext4_ioctl_checkpoint(struct file *filp, unsigned long arg) in ext4_ioctl_checkpoint() argument 809 struct super_block *sb = file_inode(filp)->i_sb; in ext4_ioctl_checkpoint() 855 static long __ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) in __ext4_ioctl() argument 857 struct inode *inode = file_inode(filp); in __ext4_ioctl() 859 struct user_namespace *mnt_userns = file_mnt_user_ns(filp); in __ext4_ioctl() 885 err = mnt_want_write_file(filp); in __ext4_ioctl() 910 mnt_drop_write_file(filp); in __ext4_ioctl() 933 err = mnt_want_write_file(filp); in __ext4_ioctl() [all …]
|
D | dir.c | 79 struct inode *dir, struct file *filp, in __ext4_check_dir_entry() argument 110 if (filp) in __ext4_check_dir_entry() 111 ext4_error_file(filp, function, line, bh->b_blocknr, in __ext4_check_dir_entry() 334 static inline loff_t hash2pos(struct file *filp, __u32 major, __u32 minor) in hash2pos() argument 336 if ((filp->f_mode & FMODE_32BITHASH) || in hash2pos() 337 (!(filp->f_mode & FMODE_64BITHASH) && is_32bit_api())) in hash2pos() 343 static inline __u32 pos2maj_hash(struct file *filp, loff_t pos) in pos2maj_hash() argument 345 if ((filp->f_mode & FMODE_32BITHASH) || in pos2maj_hash() 346 (!(filp->f_mode & FMODE_64BITHASH) && is_32bit_api())) in pos2maj_hash() 352 static inline __u32 pos2min_hash(struct file *filp, loff_t pos) in pos2min_hash() argument [all …]
|
/fs/notify/dnotify/ |
D | dnotify.c | 135 void dnotify_flush(struct file *filp, fl_owner_t id) in dnotify_flush() argument 144 inode = file_inode(filp); in dnotify_flush() 158 if ((dn->dn_owner == id) && (dn->dn_filp == filp)) { in dnotify_flush() 213 fl_owner_t id, int fd, struct file *filp, __u32 mask) in attach_dn() argument 220 if ((odn->dn_owner == id) && (odn->dn_filp == filp)) { in attach_dn() 230 dn->dn_filp = filp; in attach_dn() 243 int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg) in fcntl_dirnotify() argument 265 dnotify_flush(filp, id); in fcntl_dirnotify() 271 inode = file_inode(filp); in fcntl_dirnotify() 283 error = security_path_notify(&filp->f_path, mask, in fcntl_dirnotify() [all …]
|
/fs/xfs/ |
D | xfs_ioctl.c | 193 struct file *filp; in xfs_open_by_handle() local 244 filp = dentry_open(&path, hreq->oflags, cred); in xfs_open_by_handle() 246 if (IS_ERR(filp)) { in xfs_open_by_handle() 248 return PTR_ERR(filp); in xfs_open_by_handle() 252 filp->f_flags |= O_NOATIME; in xfs_open_by_handle() 253 filp->f_mode |= FMODE_NOCMTIME; in xfs_open_by_handle() 256 fd_install(fd, filp); in xfs_open_by_handle() 632 struct file *filp, in xfs_ioc_space() argument 635 struct inode *inode = file_inode(filp); in xfs_ioc_space() 645 if (!(filp->f_mode & FMODE_WRITE)) in xfs_ioc_space() [all …]
|
D | xfs_ioctl32.c | 435 struct file *filp, in xfs_file_compat_ioctl() argument 439 struct inode *inode = file_inode(filp); in xfs_file_compat_ioctl() 457 return xfs_ioc_space(filp, &bf); in xfs_file_compat_ioctl() 466 error = mnt_want_write_file(filp); in xfs_file_compat_ioctl() 470 mnt_drop_write_file(filp); in xfs_file_compat_ioctl() 478 error = mnt_want_write_file(filp); in xfs_file_compat_ioctl() 482 mnt_drop_write_file(filp); in xfs_file_compat_ioctl() 489 return xfs_file_ioctl(filp, cmd, p); in xfs_file_compat_ioctl() 499 error = mnt_want_write_file(filp); in xfs_file_compat_ioctl() 503 mnt_drop_write_file(filp); in xfs_file_compat_ioctl() [all …]
|
/fs/ext2/ |
D | ioctl.c | 54 long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) in ext2_ioctl() argument 56 struct inode *inode = file_inode(filp); in ext2_ioctl() 71 ret = mnt_want_write_file(filp); in ext2_ioctl() 86 mnt_drop_write_file(filp); in ext2_ioctl() 108 ret = mnt_want_write_file(filp); in ext2_ioctl() 135 mnt_drop_write_file(filp); in ext2_ioctl()
|
/fs/jffs2/ |
D | file.c | 24 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() 121 static int jffs2_readpage (struct file *filp, struct page *pg) in jffs2_readpage() argument 132 static int jffs2_write_begin(struct file *filp, struct address_space *mapping, in jffs2_write_begin() argument 245 static int jffs2_write_end(struct file *filp, struct address_space *mapping, in jffs2_write_end() argument
|
/fs/nfsd/ |
D | lockd.c | 28 nlm_fopen(struct svc_rqst *rqstp, struct nfs_fh *f, struct file **filp, in nlm_fopen() argument 43 nfserr = nfsd_open(rqstp, &fh, S_IFREG, access, filp); in nlm_fopen() 61 nlm_fclose(struct file *filp) in nlm_fclose() argument 63 fput(filp); in nlm_fclose()
|
/fs/fuse/ |
D | passthrough.c | 81 struct file *passthrough_filp = ff->passthrough.filp; in fuse_passthrough_read_iter() 123 struct file *passthrough_filp = ff->passthrough.filp; in fuse_passthrough_write_iter() 173 struct file *passthrough_filp = ff->passthrough.filp; in fuse_passthrough_mmap() 237 passthrough->filp = passthrough_filp; in fuse_passthrough_open() 286 if (passthrough->filp) { in fuse_passthrough_release() 287 fput(passthrough->filp); in fuse_passthrough_release() 288 passthrough->filp = NULL; in fuse_passthrough_release()
|