diff options
author | Jens Axboe <axboe@kernel.dk> | 2021-04-12 06:40:02 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-04-12 06:40:02 -0600 |
commit | a1ff1e3f0e1cb8e314220e7af8eb3155da343bf9 (patch) | |
tree | 53727567d05876ccdcee7c00253179a44c59faa5 /fs/io_uring.c | |
parent | 8d13326e56c1a2b4e3af89843e1376b72a2ae6b7 (diff) | |
download | lwn-a1ff1e3f0e1cb8e314220e7af8eb3155da343bf9.tar.gz lwn-a1ff1e3f0e1cb8e314220e7af8eb3155da343bf9.zip |
io_uring: provide io_resubmit_prep() stub for !CONFIG_BLOCK
Randy reports the following error on CONFIG_BLOCK not being set:
../fs/io_uring.c: In function ‘kiocb_done’:
../fs/io_uring.c:2766:7: error: implicit declaration of function ‘io_resubmit_prep’; did you mean ‘io_put_req’? [-Werror=implicit-function-declaration]
if (io_resubmit_prep(req)) {
Provide a dummy stub for io_resubmit_prep() like we do for
io_rw_should_reissue(), which also helps remove an ifdef sequence from
io_complete_rw_iopoll() as well.
Fixes: 8c130827f417 ("io_uring: don't alter iopoll reissue fail ret code")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r-- | fs/io_uring.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index 3a837d2b8331..aa29918944f6 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -2464,6 +2464,10 @@ static bool io_rw_should_reissue(struct io_kiocb *req) return true; } #else +static bool io_resubmit_prep(struct io_kiocb *req) +{ + return false; +} static bool io_rw_should_reissue(struct io_kiocb *req) { return false; @@ -2504,14 +2508,8 @@ static void io_complete_rw_iopoll(struct kiocb *kiocb, long res, long res2) if (kiocb->ki_flags & IOCB_WRITE) kiocb_end_write(req); if (unlikely(res != req->result)) { - bool fail = true; - -#ifdef CONFIG_BLOCK - if (res == -EAGAIN && io_rw_should_reissue(req) && - io_resubmit_prep(req)) - fail = false; -#endif - if (fail) { + if (!(res == -EAGAIN && io_rw_should_reissue(req) && + io_resubmit_prep(req))) { req_set_fail_links(req); req->flags |= REQ_F_DONT_REISSUE; } |