/fs/ext4/ |
D | file.c | 39 static bool ext4_dio_supported(struct kiocb *iocb, struct iov_iter *iter) in ext4_dio_supported() argument 41 struct inode *inode = file_inode(iocb->ki_filp); in ext4_dio_supported() 43 if (!fscrypt_dio_supported(iocb, iter)) in ext4_dio_supported() 54 static ssize_t ext4_dio_read_iter(struct kiocb *iocb, struct iov_iter *to) in ext4_dio_read_iter() argument 57 struct inode *inode = file_inode(iocb->ki_filp); in ext4_dio_read_iter() 59 if (iocb->ki_flags & IOCB_NOWAIT) { in ext4_dio_read_iter() 66 if (!ext4_dio_supported(iocb, to)) { in ext4_dio_read_iter() 75 iocb->ki_flags &= ~IOCB_DIRECT; in ext4_dio_read_iter() 76 return generic_file_read_iter(iocb, to); in ext4_dio_read_iter() 79 ret = iomap_dio_rw(iocb, to, &ext4_iomap_ops, NULL, in ext4_dio_read_iter() [all …]
|
/fs/ |
D | aio.c | 566 void kiocb_set_cancel_fn(struct kiocb *iocb, kiocb_cancel_fn *cancel) in kiocb_set_cancel_fn() argument 568 struct aio_kiocb *req = container_of(iocb, struct aio_kiocb, rw); in kiocb_set_cancel_fn() 576 if (!(iocb->ki_flags & IOCB_AIO_RW)) in kiocb_set_cancel_fn() 1087 static inline void iocb_destroy(struct aio_kiocb *iocb) in iocb_destroy() argument 1089 if (iocb->ki_eventfd) in iocb_destroy() 1090 eventfd_ctx_put(iocb->ki_eventfd); in iocb_destroy() 1091 if (iocb->ki_filp) in iocb_destroy() 1092 fput(iocb->ki_filp); in iocb_destroy() 1093 percpu_ref_put(&iocb->ki_ctx->reqs); in iocb_destroy() 1094 kmem_cache_free(kiocb_cachep, iocb); in iocb_destroy() [all …]
|
D | block_dev.c | 216 static unsigned int dio_bio_write_op(struct kiocb *iocb) in dio_bio_write_op() argument 221 if (iocb->ki_flags & IOCB_DSYNC) in dio_bio_write_op() 237 __blkdev_direct_IO_simple(struct kiocb *iocb, struct iov_iter *iter, in __blkdev_direct_IO_simple() argument 240 struct file *file = iocb->ki_filp; in __blkdev_direct_IO_simple() 243 loff_t pos = iocb->ki_pos; in __blkdev_direct_IO_simple() 265 bio.bi_write_hint = iocb->ki_hint; in __blkdev_direct_IO_simple() 268 bio.bi_ioprio = iocb->ki_ioprio; in __blkdev_direct_IO_simple() 280 bio.bi_opf = dio_bio_write_op(iocb); in __blkdev_direct_IO_simple() 283 if (iocb->ki_flags & IOCB_NOWAIT) in __blkdev_direct_IO_simple() 285 if (iocb->ki_flags & IOCB_HIPRI) in __blkdev_direct_IO_simple() [all …]
|
D | direct-io.c | 143 struct kiocb *iocb; /* kiocb */ member 239 loff_t offset = dio->iocb->ki_pos; in dio_complete() 273 err = dio->end_io(dio->iocb, offset, ret, dio->private); in dio_complete() 297 dio_warn_stale_pagecache(dio->iocb->ki_filp); in dio_complete() 308 dio->iocb->ki_pos += transferred; in dio_complete() 311 ret = generic_write_sync(dio->iocb, ret); in dio_complete() 312 dio->iocb->ki_complete(dio->iocb, ret, 0); in dio_complete() 415 bio->bi_write_hint = dio->iocb->ki_hint; in dio_bio_alloc() 487 if (!(dio->iocb->ki_flags & IOCB_HIPRI) || in dio_await_one() 1140 do_blockdev_direct_IO(struct kiocb *iocb, struct inode *inode, in do_blockdev_direct_IO() argument [all …]
|
/fs/xfs/ |
D | xfs_file.c | 219 struct kiocb *iocb, in xfs_file_dio_aio_read() argument 222 struct xfs_inode *ip = XFS_I(file_inode(iocb->ki_filp)); in xfs_file_dio_aio_read() 226 trace_xfs_file_direct_read(ip, count, iocb->ki_pos); in xfs_file_dio_aio_read() 231 file_accessed(iocb->ki_filp); in xfs_file_dio_aio_read() 233 if (iocb->ki_flags & IOCB_NOWAIT) { in xfs_file_dio_aio_read() 239 ret = iomap_dio_rw(iocb, to, &xfs_read_iomap_ops, NULL, in xfs_file_dio_aio_read() 240 is_sync_kiocb(iocb)); in xfs_file_dio_aio_read() 248 struct kiocb *iocb, in xfs_file_dax_read() argument 251 struct xfs_inode *ip = XFS_I(iocb->ki_filp->f_mapping->host); in xfs_file_dax_read() 255 trace_xfs_file_dax_read(ip, count, iocb->ki_pos); in xfs_file_dax_read() [all …]
|
/fs/ext2/ |
D | file.c | 33 static ssize_t ext2_dax_read_iter(struct kiocb *iocb, struct iov_iter *to) in ext2_dax_read_iter() argument 35 struct inode *inode = iocb->ki_filp->f_mapping->host; in ext2_dax_read_iter() 42 ret = dax_iomap_rw(iocb, to, &ext2_iomap_ops); in ext2_dax_read_iter() 45 file_accessed(iocb->ki_filp); in ext2_dax_read_iter() 49 static ssize_t ext2_dax_write_iter(struct kiocb *iocb, struct iov_iter *from) in ext2_dax_write_iter() argument 51 struct file *file = iocb->ki_filp; in ext2_dax_write_iter() 56 ret = generic_write_checks(iocb, from); in ext2_dax_write_iter() 66 ret = dax_iomap_rw(iocb, from, &ext2_iomap_ops); in ext2_dax_write_iter() 67 if (ret > 0 && iocb->ki_pos > i_size_read(inode)) { in ext2_dax_write_iter() 68 i_size_write(inode, iocb->ki_pos); in ext2_dax_write_iter() [all …]
|
/fs/iomap/ |
D | direct-io.c | 28 struct kiocb *iocb; member 68 if (dio->iocb->ki_flags & IOCB_HIPRI) in iomap_dio_submit_bio() 69 bio_set_polled(bio, dio->iocb); in iomap_dio_submit_bio() 74 file_inode(dio->iocb->ki_filp), in iomap_dio_submit_bio() 83 struct kiocb *iocb = dio->iocb; in iomap_dio_complete() local 84 struct inode *inode = file_inode(iocb->ki_filp); in iomap_dio_complete() 85 loff_t offset = iocb->ki_pos; in iomap_dio_complete() 89 ret = dops->end_io(iocb, dio->size, ret, dio->flags); in iomap_dio_complete() 97 iocb->ki_pos += ret; in iomap_dio_complete() 119 dio_warn_stale_pagecache(iocb->ki_filp); in iomap_dio_complete() [all …]
|
/fs/ocfs2/ |
D | aops.h | 53 #define ocfs2_iocb_is_rw_locked(iocb) \ argument 54 test_bit(0, (unsigned long *)&iocb->private) 55 static inline void ocfs2_iocb_set_rw_locked(struct kiocb *iocb, int level) in ocfs2_iocb_set_rw_locked() argument 57 set_bit(0, (unsigned long *)&iocb->private); in ocfs2_iocb_set_rw_locked() 59 set_bit(1, (unsigned long *)&iocb->private); in ocfs2_iocb_set_rw_locked() 61 clear_bit(1, (unsigned long *)&iocb->private); in ocfs2_iocb_set_rw_locked() 75 #define ocfs2_iocb_clear_rw_locked(iocb) \ argument 76 clear_bit(OCFS2_IOCB_RW_LOCK, (unsigned long *)&iocb->private) 77 #define ocfs2_iocb_rw_locked_level(iocb) \ argument 78 test_bit(OCFS2_IOCB_RW_LOCK_LEVEL, (unsigned long *)&iocb->private)
|
D | file.c | 2355 static ssize_t ocfs2_file_write_iter(struct kiocb *iocb, in ocfs2_file_write_iter() argument 2362 struct file *file = iocb->ki_filp; in ocfs2_file_write_iter() 2368 int append_write = ((iocb->ki_pos + count) >= in ocfs2_file_write_iter() 2370 int direct_io = iocb->ki_flags & IOCB_DIRECT ? 1 : 0; in ocfs2_file_write_iter() 2371 int nowait = iocb->ki_flags & IOCB_NOWAIT ? 1 : 0; in ocfs2_file_write_iter() 2431 ret = generic_write_checks(iocb, from); in ocfs2_file_write_iter() 2439 ret = ocfs2_prepare_inode_for_write(file, iocb->ki_pos, count, !nowait); in ocfs2_file_write_iter() 2446 if (direct_io && !is_sync_kiocb(iocb) && in ocfs2_file_write_iter() 2447 ocfs2_is_io_unaligned(inode, count, iocb->ki_pos)) { in ocfs2_file_write_iter() 2451 saved_ki_complete = xchg(&iocb->ki_complete, NULL); in ocfs2_file_write_iter() [all …]
|
/fs/overlayfs/ |
D | file.c | 21 struct kiocb iocb; member 249 fput(aio_req->iocb.ki_filp); in ovl_aio_put() 256 struct kiocb *iocb = &aio_req->iocb; in ovl_aio_cleanup_handler() local 259 if (iocb->ki_flags & IOCB_WRITE) { in ovl_aio_cleanup_handler() 263 __sb_writers_acquired(file_inode(iocb->ki_filp)->i_sb, in ovl_aio_cleanup_handler() 265 file_end_write(iocb->ki_filp); in ovl_aio_cleanup_handler() 269 orig_iocb->ki_pos = iocb->ki_pos; in ovl_aio_cleanup_handler() 273 static void ovl_aio_rw_complete(struct kiocb *iocb, long res, long res2) in ovl_aio_rw_complete() argument 275 struct ovl_aio_req *aio_req = container_of(iocb, in ovl_aio_rw_complete() 276 struct ovl_aio_req, iocb); in ovl_aio_rw_complete() [all …]
|
/fs/fuse/ |
D | passthrough.c | 13 struct kiocb iocb; member 50 struct kiocb *iocb = &aio_req->iocb; in fuse_aio_cleanup_handler() local 53 if (iocb->ki_flags & IOCB_WRITE) { in fuse_aio_cleanup_handler() 54 __sb_writers_acquired(file_inode(iocb->ki_filp)->i_sb, in fuse_aio_cleanup_handler() 56 file_end_write(iocb->ki_filp); in fuse_aio_cleanup_handler() 57 fuse_copyattr(iocb_fuse->ki_filp, iocb->ki_filp); in fuse_aio_cleanup_handler() 60 iocb_fuse->ki_pos = iocb->ki_pos; in fuse_aio_cleanup_handler() 64 static void fuse_aio_rw_complete(struct kiocb *iocb, long res, long res2) in fuse_aio_rw_complete() argument 67 container_of(iocb, struct fuse_aio_req, iocb); in fuse_aio_rw_complete() 101 kiocb_clone(&aio_req->iocb, iocb_fuse, passthrough_filp); in fuse_passthrough_read_iter() [all …]
|
D | file.c | 677 struct inode *inode = file_inode(io->iocb->ki_filp); in fuse_aio_complete() 686 io->iocb->ki_complete(io->iocb, res, 0); in fuse_aio_complete() 769 struct file *file = ia->io->iocb->ki_filp; in fuse_send_read() 998 static ssize_t fuse_cache_read_iter(struct kiocb *iocb, struct iov_iter *to) in fuse_cache_read_iter() argument 1000 struct inode *inode = iocb->ki_filp->f_mapping->host; in fuse_cache_read_iter() 1009 (iocb->ki_pos + iov_iter_count(to) > i_size_read(inode))) { in fuse_cache_read_iter() 1011 err = fuse_update_attributes(inode, iocb->ki_filp); in fuse_cache_read_iter() 1016 return generic_file_read_iter(iocb, to); in fuse_cache_read_iter() 1041 static unsigned int fuse_write_flags(struct kiocb *iocb) in fuse_write_flags() argument 1043 unsigned int flags = iocb->ki_filp->f_flags; in fuse_write_flags() [all …]
|
D | dax.c | 701 ssize_t fuse_dax_read_iter(struct kiocb *iocb, struct iov_iter *to) in fuse_dax_read_iter() argument 703 struct inode *inode = file_inode(iocb->ki_filp); in fuse_dax_read_iter() 706 if (iocb->ki_flags & IOCB_NOWAIT) { in fuse_dax_read_iter() 713 ret = dax_iomap_rw(iocb, to, &fuse_iomap_ops); in fuse_dax_read_iter() 720 static bool file_extending_write(struct kiocb *iocb, struct iov_iter *from) in file_extending_write() argument 722 struct inode *inode = file_inode(iocb->ki_filp); in file_extending_write() 725 ((iocb->ki_pos) >= i_size_read(inode) || in file_extending_write() 726 (iocb->ki_pos + iov_iter_count(from) > i_size_read(inode)))); in file_extending_write() 729 static ssize_t fuse_dax_direct_write(struct kiocb *iocb, struct iov_iter *from) in fuse_dax_direct_write() argument 731 struct inode *inode = file_inode(iocb->ki_filp); in fuse_dax_direct_write() [all …]
|
/fs/zonefs/ |
D | super.c | 712 static int zonefs_file_write_dio_end_io(struct kiocb *iocb, ssize_t size, in zonefs_file_write_dio_end_io() argument 715 struct inode *inode = file_inode(iocb->ki_filp); in zonefs_file_write_dio_end_io() 732 if (i_size_read(inode) < iocb->ki_pos + size) { in zonefs_file_write_dio_end_io() 733 zonefs_update_stats(inode, iocb->ki_pos + size); in zonefs_file_write_dio_end_io() 734 zonefs_i_size_write(inode, iocb->ki_pos + size); in zonefs_file_write_dio_end_io() 746 static ssize_t zonefs_file_dio_append(struct kiocb *iocb, struct iov_iter *from) in zonefs_file_dio_append() argument 748 struct inode *inode = file_inode(iocb->ki_filp); in zonefs_file_dio_append() 771 bio->bi_write_hint = iocb->ki_hint; in zonefs_file_dio_append() 772 bio->bi_ioprio = iocb->ki_ioprio; in zonefs_file_dio_append() 774 if (iocb->ki_flags & IOCB_DSYNC) in zonefs_file_dio_append() [all …]
|
/fs/nfs/ |
D | direct.c | 73 struct kiocb * iocb; /* controlling i/o request */ member 164 ssize_t nfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter) in nfs_direct_IO() argument 166 struct inode *inode = iocb->ki_filp->f_mapping->host; in nfs_direct_IO() 175 return nfs_file_direct_read(iocb, iter, true); in nfs_direct_IO() 176 return nfs_file_direct_write(iocb, iter, true); in nfs_direct_IO() 246 if (dreq->iocb) in nfs_direct_wait() 272 if (dreq->iocb) { in nfs_direct_complete() 278 dreq->iocb->ki_complete(dreq->iocb, res, 0); in nfs_direct_complete() 443 ssize_t nfs_file_direct_read(struct kiocb *iocb, struct iov_iter *iter, in nfs_file_direct_read() argument 446 struct file *file = iocb->ki_filp; in nfs_file_direct_read() [all …]
|
D | file.c | 158 nfs_file_read(struct kiocb *iocb, struct iov_iter *to) in nfs_file_read() argument 160 struct inode *inode = file_inode(iocb->ki_filp); in nfs_file_read() 163 if (iocb->ki_flags & IOCB_DIRECT) in nfs_file_read() 164 return nfs_file_direct_read(iocb, to, false); in nfs_file_read() 167 iocb->ki_filp, in nfs_file_read() 168 iov_iter_count(to), (unsigned long) iocb->ki_pos); in nfs_file_read() 171 result = nfs_revalidate_mapping(inode, iocb->ki_filp->f_mapping); in nfs_file_read() 173 result = generic_file_read_iter(iocb, to); in nfs_file_read() 612 ssize_t nfs_file_write(struct kiocb *iocb, struct iov_iter *from) in nfs_file_write() argument 614 struct file *file = iocb->ki_filp; in nfs_file_write() [all …]
|
/fs/gfs2/ |
D | file.c | 785 static ssize_t gfs2_file_direct_read(struct kiocb *iocb, struct iov_iter *to, in gfs2_file_direct_read() argument 788 struct file *file = iocb->ki_filp; in gfs2_file_direct_read() 801 ret = iomap_dio_rw(iocb, to, &gfs2_iomap_ops, NULL, in gfs2_file_direct_read() 802 is_sync_kiocb(iocb)); in gfs2_file_direct_read() 810 static ssize_t gfs2_file_direct_write(struct kiocb *iocb, struct iov_iter *from, in gfs2_file_direct_write() argument 813 struct file *file = iocb->ki_filp; in gfs2_file_direct_write() 817 loff_t offset = iocb->ki_pos; in gfs2_file_direct_write() 837 ret = iomap_dio_rw(iocb, from, &gfs2_iomap_ops, NULL, in gfs2_file_direct_write() 838 is_sync_kiocb(iocb)); in gfs2_file_direct_write() 848 static ssize_t gfs2_file_read_iter(struct kiocb *iocb, struct iov_iter *to) in gfs2_file_read_iter() argument [all …]
|
/fs/9p/ |
D | vfs_file.c | 383 v9fs_file_read_iter(struct kiocb *iocb, struct iov_iter *to) in v9fs_file_read_iter() argument 385 struct p9_fid *fid = iocb->ki_filp->private_data; in v9fs_file_read_iter() 389 iov_iter_count(to), iocb->ki_pos); in v9fs_file_read_iter() 391 if (iocb->ki_filp->f_flags & O_NONBLOCK) in v9fs_file_read_iter() 392 ret = p9_client_read_once(fid, iocb->ki_pos, to, &err); in v9fs_file_read_iter() 394 ret = p9_client_read(fid, iocb->ki_pos, to, &err); in v9fs_file_read_iter() 398 iocb->ki_pos += ret; in v9fs_file_read_iter() 411 v9fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from) in v9fs_file_write_iter() argument 413 struct file *file = iocb->ki_filp; in v9fs_file_write_iter() 418 retval = generic_write_checks(iocb, from); in v9fs_file_write_iter() [all …]
|
/fs/ceph/ |
D | file.c | 866 static ssize_t ceph_sync_read(struct kiocb *iocb, struct iov_iter *to, in ceph_sync_read() argument 869 struct file *file = iocb->ki_filp; in ceph_sync_read() 875 u64 off = iocb->ki_pos; in ceph_sync_read() 982 if (off > iocb->ki_pos) { in ceph_sync_read() 986 ret = off - iocb->ki_pos; in ceph_sync_read() 987 iocb->ki_pos = off; in ceph_sync_read() 995 struct kiocb *iocb; member 1023 if (aio_req->iocb->ki_flags & IOCB_DIRECT) in ceph_aio_complete() 1035 loff_t endoff = aio_req->iocb->ki_pos + aio_req->total_len; in ceph_aio_complete() 1054 aio_req->iocb->ki_complete(aio_req->iocb, ret, 0); in ceph_aio_complete() [all …]
|
/fs/cifs/ |
D | cifsfs.h | 105 extern ssize_t cifs_user_readv(struct kiocb *iocb, struct iov_iter *to); 106 extern ssize_t cifs_direct_readv(struct kiocb *iocb, struct iov_iter *to); 107 extern ssize_t cifs_strict_readv(struct kiocb *iocb, struct iov_iter *to); 108 extern ssize_t cifs_user_writev(struct kiocb *iocb, struct iov_iter *from); 109 extern ssize_t cifs_direct_writev(struct kiocb *iocb, struct iov_iter *from); 110 extern ssize_t cifs_strict_writev(struct kiocb *iocb, struct iov_iter *from);
|
D | file.c | 3138 if (ctx->iocb && ctx->iocb->ki_complete) in collect_uncached_write_data() 3139 ctx->iocb->ki_complete(ctx->iocb, ctx->rc, 0); in collect_uncached_write_data() 3145 struct kiocb *iocb, struct iov_iter *from, bool direct) in __cifs_writev() argument 3147 struct file *file = iocb->ki_filp; in __cifs_writev() 3167 rc = generic_write_checks(iocb, from); in __cifs_writev() 3184 if (!is_sync_kiocb(iocb)) in __cifs_writev() 3185 ctx->iocb = iocb; in __cifs_writev() 3187 ctx->pos = iocb->ki_pos; in __cifs_writev() 3204 rc = cifs_write_from_iter(iocb->ki_pos, ctx->len, &saved_from, in __cifs_writev() 3223 if (!is_sync_kiocb(iocb)) { in __cifs_writev() [all …]
|
/fs/coda/ |
D | file.c | 38 coda_file_read_iter(struct kiocb *iocb, struct iov_iter *to) in coda_file_read_iter() argument 40 struct file *coda_file = iocb->ki_filp; in coda_file_read_iter() 43 loff_t ki_pos = iocb->ki_pos; in coda_file_read_iter() 53 ret = vfs_iter_read(cfi->cfi_container, to, &iocb->ki_pos, 0); in coda_file_read_iter() 63 coda_file_write_iter(struct kiocb *iocb, struct iov_iter *to) in coda_file_write_iter() argument 65 struct file *coda_file = iocb->ki_filp; in coda_file_write_iter() 69 loff_t ki_pos = iocb->ki_pos; in coda_file_write_iter() 81 ret = vfs_iter_write(cfi->cfi_container, to, &iocb->ki_pos, 0); in coda_file_write_iter()
|
/fs/udf/ |
D | file.c | 107 static ssize_t udf_adinicb_direct_IO(struct kiocb *iocb, struct iov_iter *iter) in udf_adinicb_direct_IO() argument 135 static ssize_t udf_file_write_iter(struct kiocb *iocb, struct iov_iter *from) in udf_file_write_iter() argument 138 struct file *file = iocb->ki_filp; in udf_file_write_iter() 145 retval = generic_write_checks(iocb, from); in udf_file_write_iter() 152 iocb->ki_pos + iov_iter_count(from))) { in udf_file_write_iter() 162 retval = __generic_file_write_iter(iocb, from); in udf_file_write_iter() 172 retval = generic_write_sync(iocb, retval); in udf_file_write_iter()
|
/fs/orangefs/ |
D | file.c | 345 static ssize_t orangefs_file_read_iter(struct kiocb *iocb, in orangefs_file_read_iter() argument 351 down_read(&file_inode(iocb->ki_filp)->i_rwsem); in orangefs_file_read_iter() 352 ret = orangefs_revalidate_mapping(file_inode(iocb->ki_filp)); in orangefs_file_read_iter() 356 ret = generic_file_read_iter(iocb, iter); in orangefs_file_read_iter() 358 up_read(&file_inode(iocb->ki_filp)->i_rwsem); in orangefs_file_read_iter() 362 static ssize_t orangefs_file_write_iter(struct kiocb *iocb, in orangefs_file_write_iter() argument 368 if (iocb->ki_pos > i_size_read(file_inode(iocb->ki_filp))) { in orangefs_file_write_iter() 369 ret = orangefs_revalidate_mapping(file_inode(iocb->ki_filp)); in orangefs_file_write_iter() 374 ret = generic_file_write_iter(iocb, iter); in orangefs_file_write_iter()
|
/fs/kernfs/ |
D | file.c | 184 static ssize_t kernfs_file_read_iter(struct kiocb *iocb, struct iov_iter *iter) in kernfs_file_read_iter() argument 186 struct kernfs_open_file *of = kernfs_of(iocb->ki_filp); in kernfs_file_read_iter() 213 len = ops->read(of, buf, len, iocb->ki_pos); in kernfs_file_read_iter() 228 iocb->ki_pos += len; in kernfs_file_read_iter() 238 static ssize_t kernfs_fop_read_iter(struct kiocb *iocb, struct iov_iter *iter) in kernfs_fop_read_iter() argument 240 if (kernfs_of(iocb->ki_filp)->kn->flags & KERNFS_HAS_SEQ_SHOW) in kernfs_fop_read_iter() 241 return seq_read_iter(iocb, iter); in kernfs_fop_read_iter() 242 return kernfs_file_read_iter(iocb, iter); in kernfs_fop_read_iter() 255 static ssize_t kernfs_fop_write_iter(struct kiocb *iocb, struct iov_iter *iter) in kernfs_fop_write_iter() argument 257 struct kernfs_open_file *of = kernfs_of(iocb->ki_filp); in kernfs_fop_write_iter() [all …]
|