Commit 99a10081 authored by Jens Axboe's avatar Jens Axboe

io_uring: make the !CONFIG_NET helpers a bit more robust

With the prep and prep async split, we now have potentially 3 helpers
that need to be defined for !CONFIG_NET. Add some helpers to do just
that.

Fixes the following compile error on !CONFIG_NET:

fs/io_uring.c:6171:10: error: implicit declaration of function
'io_sendmsg_prep_async'; did you mean 'io_req_prep_async'?
[-Werror=implicit-function-declaration]
   return io_sendmsg_prep_async(req);
             ^~~~~~~~~~~~~~~~~~~~~
	     io_req_prep_async

Fixes: 93642ef8 ("io_uring: split sqe-prep and async setup")
Reported-by: default avatarNaresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 8bad28d8
...@@ -5128,56 +5128,32 @@ static int io_connect(struct io_kiocb *req, unsigned int issue_flags) ...@@ -5128,56 +5128,32 @@ static int io_connect(struct io_kiocb *req, unsigned int issue_flags)
return 0; return 0;
} }
#else /* !CONFIG_NET */ #else /* !CONFIG_NET */
static int io_sendmsg_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) #define IO_NETOP_FN(op) \
{ static int io_##op(struct io_kiocb *req, unsigned int issue_flags) \
return -EOPNOTSUPP; { \
} return -EOPNOTSUPP; \
}
static int io_sendmsg(struct io_kiocb *req, unsigned int issue_flags)
{ #define IO_NETOP_PREP(op) \
return -EOPNOTSUPP; IO_NETOP_FN(op) \
} static int io_##op##_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) \
{ \
static int io_send(struct io_kiocb *req, unsigned int issue_flags) return -EOPNOTSUPP; \
{ } \
return -EOPNOTSUPP;
} #define IO_NETOP_PREP_ASYNC(op) \
IO_NETOP_PREP(op) \
static int io_recvmsg_prep(struct io_kiocb *req, static int io_##op##_prep_async(struct io_kiocb *req) \
const struct io_uring_sqe *sqe) { \
{ return -EOPNOTSUPP; \
return -EOPNOTSUPP; }
}
IO_NETOP_PREP_ASYNC(sendmsg);
static int io_recvmsg(struct io_kiocb *req, unsigned int issue_flags) IO_NETOP_PREP_ASYNC(recvmsg);
{ IO_NETOP_PREP_ASYNC(connect);
return -EOPNOTSUPP; IO_NETOP_PREP(accept);
} IO_NETOP_FN(send);
IO_NETOP_FN(recv);
static int io_recv(struct io_kiocb *req, unsigned int issue_flags)
{
return -EOPNOTSUPP;
}
static int io_accept_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
{
return -EOPNOTSUPP;
}
static int io_accept(struct io_kiocb *req, unsigned int issue_flags)
{
return -EOPNOTSUPP;
}
static int io_connect_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
{
return -EOPNOTSUPP;
}
static int io_connect(struct io_kiocb *req, unsigned int issue_flags)
{
return -EOPNOTSUPP;
}
#endif /* CONFIG_NET */ #endif /* CONFIG_NET */
struct io_poll_table { struct io_poll_table {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment