Lines Matching refs:ret
149 int ret; in dio_refill_pages() local
153 ret = get_user_pages_fast( in dio_refill_pages()
159 if (ret < 0 && dio->blocks_available && (dio->rw & WRITE)) { in dio_refill_pages()
167 dio->page_errors = ret; in dio_refill_pages()
172 ret = 0; in dio_refill_pages()
176 if (ret >= 0) { in dio_refill_pages()
177 dio->curr_user_address += ret * PAGE_SIZE; in dio_refill_pages()
178 dio->curr_page += ret; in dio_refill_pages()
180 dio->tail = ret; in dio_refill_pages()
181 ret = 0; in dio_refill_pages()
184 return ret; in dio_refill_pages()
196 int ret; in dio_get_page() local
198 ret = dio_refill_pages(dio); in dio_get_page()
199 if (ret) in dio_get_page()
200 return ERR_PTR(ret); in dio_get_page()
219 static int dio_complete(struct dio *dio, loff_t offset, int ret) in dio_complete() argument
229 if (ret == -EIOCBQUEUED) in dio_complete()
230 ret = 0; in dio_complete()
247 if (ret == 0) in dio_complete()
248 ret = dio->page_errors; in dio_complete()
249 if (ret == 0) in dio_complete()
250 ret = dio->io_error; in dio_complete()
251 if (ret == 0) in dio_complete()
252 ret = transferred; in dio_complete()
254 return ret; in dio_complete()
277 int ret = dio_complete(dio, dio->iocb->ki_pos, 0); in dio_bio_end_aio() local
278 aio_complete(dio->iocb, ret, 0); in dio_bio_end_aio()
449 int ret = 0; in dio_bio_reap() local
462 if (ret == 0) in dio_bio_reap()
463 ret = ret2; in dio_bio_reap()
467 return ret; in dio_bio_reap()
495 int ret; in get_more_blocks() local
507 ret = dio->page_errors; in get_more_blocks()
508 if (ret == 0) { in get_more_blocks()
535 ret = (*dio->get_block)(dio->inode, fs_startblk, in get_more_blocks()
538 return ret; in get_more_blocks()
547 int ret, nr_pages; in dio_new_bio() local
549 ret = dio_bio_reap(dio); in dio_new_bio()
550 if (ret) in dio_new_bio()
555 ret = dio_bio_alloc(dio, dio->map_bh.b_bdev, sector, nr_pages); in dio_new_bio()
558 return ret; in dio_new_bio()
570 int ret; in dio_bio_add_page() local
572 ret = bio_add_page(dio->bio, dio->cur_page, in dio_bio_add_page()
574 if (ret == dio->cur_page_len) { in dio_bio_add_page()
583 ret = 0; in dio_bio_add_page()
585 ret = 1; in dio_bio_add_page()
587 return ret; in dio_bio_add_page()
602 int ret = 0; in dio_send_cur_page() local
619 ret = dio_new_bio(dio, dio->cur_page_block); in dio_send_cur_page()
620 if (ret) in dio_send_cur_page()
626 ret = dio_new_bio(dio, dio->cur_page_block); in dio_send_cur_page()
627 if (ret == 0) { in dio_send_cur_page()
628 ret = dio_bio_add_page(dio); in dio_send_cur_page()
629 BUG_ON(ret != 0); in dio_send_cur_page()
633 return ret; in dio_send_cur_page()
657 int ret = 0; in submit_page_section() local
680 ret = dio_send_cur_page(dio); in submit_page_section()
691 ret = dio_send_cur_page(dio); in submit_page_section()
694 if (ret) in submit_page_section()
704 return ret; in submit_page_section()
791 int ret = 0; in do_direct_IO() local
799 ret = PTR_ERR(page); in do_direct_IO()
816 ret = get_more_blocks(dio); in do_direct_IO()
817 if (ret) { in do_direct_IO()
905 ret = submit_page_section(dio, page, offset_in_page, in do_direct_IO()
907 if (ret) { in do_direct_IO()
927 return ret; in do_direct_IO()
942 ssize_t ret = 0; in direct_io_worker() local
998 ret = do_direct_IO(dio); in direct_io_worker()
1004 if (ret) { in direct_io_worker()
1010 if (ret == -ENOTBLK && (rw & WRITE)) { in direct_io_worker()
1015 ret = 0; in direct_io_worker()
1025 if (ret == 0) in direct_io_worker()
1026 ret = ret2; in direct_io_worker()
1057 BUG_ON(ret == -EIOCBQUEUED); in direct_io_worker()
1058 if (dio->is_async && ret == 0 && dio->result && in direct_io_worker()
1060 ret = -EIOCBQUEUED; in direct_io_worker()
1062 if (ret != -EIOCBQUEUED) in direct_io_worker()
1081 ret = dio_complete(dio, offset, ret); in direct_io_worker()
1084 BUG_ON(ret != -EIOCBQUEUED); in direct_io_worker()
1086 return ret; in direct_io_worker()