Lines Matching refs:kiocb
561 struct kiocb kiocb; member
2563 struct kiocb *kiocb = &req->rw.kiocb; in io_do_iopoll() local
2578 ret = kiocb->ki_filp->f_op->iopoll(kiocb, spin); in io_do_iopoll()
2753 if (rw->kiocb.ki_flags & IOCB_WRITE) { in io_req_io_end()
2818 static void io_complete_rw(struct kiocb *kiocb, long res, long res2) in io_complete_rw() argument
2820 struct io_kiocb *req = container_of(kiocb, struct io_kiocb, rw.kiocb); in io_complete_rw()
2829 static void io_complete_rw_iopoll(struct kiocb *kiocb, long res, long res2) in io_complete_rw_iopoll() argument
2831 struct io_kiocb *req = container_of(kiocb, struct io_kiocb, rw.kiocb); in io_complete_rw_iopoll()
2833 if (kiocb->ki_flags & IOCB_WRITE) in io_complete_rw_iopoll()
2880 queue_num0 = blk_qc_t_to_queue_num(list_req->rw.kiocb.ki_cookie); in io_iopoll_req_issued()
2881 queue_num1 = blk_qc_t_to_queue_num(req->rw.kiocb.ki_cookie); in io_iopoll_req_issued()
2968 struct kiocb *kiocb = &req->rw.kiocb; in io_prep_rw() local
2976 kiocb->ki_pos = READ_ONCE(sqe->off); in io_prep_rw()
2977 kiocb->ki_hint = ki_hint_validate(file_write_hint(kiocb->ki_filp)); in io_prep_rw()
2978 kiocb->ki_flags = iocb_flags(kiocb->ki_filp); in io_prep_rw()
2979 ret = kiocb_set_rw_flags(kiocb, READ_ONCE(sqe->rw_flags)); in io_prep_rw()
2988 if ((kiocb->ki_flags & IOCB_NOWAIT) || in io_prep_rw()
2998 kiocb->ki_ioprio = ioprio; in io_prep_rw()
3000 kiocb->ki_ioprio = get_current_ioprio(); in io_prep_rw()
3003 if (!(kiocb->ki_flags & IOCB_DIRECT) || in io_prep_rw()
3004 !kiocb->ki_filp->f_op->iopoll) in io_prep_rw()
3007 kiocb->ki_flags |= IOCB_HIPRI | IOCB_ALLOC_CACHE; in io_prep_rw()
3008 kiocb->ki_complete = io_complete_rw_iopoll; in io_prep_rw()
3011 if (kiocb->ki_flags & IOCB_HIPRI) in io_prep_rw()
3013 kiocb->ki_complete = io_complete_rw; in io_prep_rw()
3037 static inline void io_rw_done(struct kiocb *kiocb, ssize_t ret) in io_rw_done() argument
3054 kiocb->ki_complete(kiocb, ret, 0); in io_rw_done()
3060 struct kiocb *kiocb = &req->rw.kiocb; in io_kiocb_update_pos() local
3062 if (kiocb->ki_pos != -1) in io_kiocb_update_pos()
3063 return &kiocb->ki_pos; in io_kiocb_update_pos()
3067 kiocb->ki_pos = req->file->f_pos; in io_kiocb_update_pos()
3068 return &kiocb->ki_pos; in io_kiocb_update_pos()
3071 kiocb->ki_pos = 0; in io_kiocb_update_pos()
3075 static void kiocb_done(struct kiocb *kiocb, ssize_t ret, in kiocb_done() argument
3078 struct io_kiocb *req = container_of(kiocb, struct io_kiocb, rw.kiocb); in kiocb_done()
3081 req->file->f_pos = kiocb->ki_pos; in kiocb_done()
3082 if (ret >= 0 && (kiocb->ki_complete == io_complete_rw)) { in kiocb_done()
3094 io_rw_done(kiocb, ret); in kiocb_done()
3363 static inline loff_t *io_kiocb_ppos(struct kiocb *kiocb) in io_kiocb_ppos() argument
3365 return (kiocb->ki_filp->f_mode & FMODE_STREAM) ? NULL : &kiocb->ki_pos; in io_kiocb_ppos()
3374 struct kiocb *kiocb = &req->rw.kiocb; in loop_rw_iter() local
3384 if (kiocb->ki_flags & IOCB_HIPRI) in loop_rw_iter()
3386 if (kiocb->ki_flags & IOCB_NOWAIT) in loop_rw_iter()
3389 ppos = io_kiocb_ppos(kiocb); in loop_rw_iter()
3537 req->rw.kiocb.ki_flags &= ~IOCB_WAITQ; in io_async_buf_func()
3559 struct kiocb *kiocb = &req->rw.kiocb; in io_rw_should_retry() local
3566 if (kiocb->ki_flags & (IOCB_DIRECT | IOCB_HIPRI)) in io_rw_should_retry()
3580 kiocb->ki_flags |= IOCB_WAITQ; in io_rw_should_retry()
3581 kiocb->ki_flags &= ~IOCB_NOWAIT; in io_rw_should_retry()
3582 kiocb->ki_waitq = wait; in io_rw_should_retry()
3589 return call_read_iter(req->file, &req->rw.kiocb, iter); in io_iter_do_read()
3605 struct kiocb *kiocb = &req->rw.kiocb; in io_read() local
3634 kiocb->ki_flags &= ~IOCB_NOWAIT; in io_read()
3636 kiocb->ki_flags |= IOCB_NOWAIT; in io_read()
3707 kiocb->ki_flags &= ~IOCB_WAITQ; in io_read()
3722 kiocb->ki_flags &= ~IOCB_WAITQ; in io_read()
3726 kiocb_done(kiocb, ret, issue_flags); in io_read()
3744 struct kiocb *kiocb = &req->rw.kiocb; in io_write() local
3768 kiocb->ki_flags &= ~IOCB_NOWAIT; in io_write()
3770 kiocb->ki_flags |= IOCB_NOWAIT; in io_write()
3777 if (force_nonblock && !(kiocb->ki_flags & IOCB_DIRECT) && in io_write()
3799 kiocb->ki_flags |= IOCB_WRITE; in io_write()
3802 ret2 = call_write_iter(req->file, kiocb, iter); in io_write()
3817 if (ret2 == -EOPNOTSUPP && (kiocb->ki_flags & IOCB_NOWAIT)) in io_write()
3827 kiocb_done(kiocb, ret2, issue_flags); in io_write()
3833 if (kiocb->ki_flags & IOCB_WRITE) in io_write()