Skip to content

Commit 1b8b5d0

Browse files
isilenceaxboe
authored andcommitted
io_uring/zcrx: elide passing msg flags
zcrx sqe->msg_flags has never been defined and checked to be zero. It doesn't need to be a MSG_* bitmask. Keep them undefined, don't mix with MSG_DONTWAIT, and don't pass into io_zcrx_recv() as it's ignored anyway. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent a0169c3 commit 1b8b5d0

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

io_uring/net.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ enum sr_retry_flags {
110110

111111
struct io_recvzc {
112112
struct file *file;
113-
unsigned msg_flags;
114113
u16 flags;
115114
u32 len;
116115
struct io_zcrx_ifq *ifq;
@@ -1253,8 +1252,7 @@ int io_recvzc_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
12531252

12541253
zc->len = READ_ONCE(sqe->len);
12551254
zc->flags = READ_ONCE(sqe->ioprio);
1256-
zc->msg_flags = READ_ONCE(sqe->msg_flags);
1257-
if (zc->msg_flags)
1255+
if (READ_ONCE(sqe->msg_flags))
12581256
return -EINVAL;
12591257
if (zc->flags & ~(IORING_RECVSEND_POLL_FIRST | IORING_RECV_MULTISHOT))
12601258
return -EINVAL;
@@ -1283,8 +1281,7 @@ int io_recvzc(struct io_kiocb *req, unsigned int issue_flags)
12831281
return -ENOTSOCK;
12841282

12851283
len = zc->len;
1286-
ret = io_zcrx_recv(req, zc->ifq, sock, zc->msg_flags | MSG_DONTWAIT,
1287-
issue_flags, &zc->len);
1284+
ret = io_zcrx_recv(req, zc->ifq, sock, 0, issue_flags, &zc->len);
12881285
if (len && zc->len == 0) {
12891286
io_req_set_res(req, 0, 0);
12901287

0 commit comments

Comments
 (0)