Commit 6e83a442 authored by Caleb Sander Mateos's avatar Caleb Sander Mateos Committed by Jens Axboe
Browse files

io_uring/nop: use io_find_buf_node()



Call io_find_buf_node() to avoid duplicating it in io_nop().

Signed-off-by: default avatarCaleb Sander Mateos <csander@purestorage.com>
Link: https://lore.kernel.org/r/20250301001610.678223-2-csander@purestorage.com


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent bf931be5
Loading
Loading
Loading
Loading
+2 −11
Original line number Diff line number Diff line
@@ -61,17 +61,8 @@ int io_nop(struct io_kiocb *req, unsigned int issue_flags)
		}
	}
	if (nop->flags & IORING_NOP_FIXED_BUFFER) {
		struct io_ring_ctx *ctx = req->ctx;
		struct io_rsrc_node *node;

		if (!io_find_buf_node(req, issue_flags))
			ret = -EFAULT;
		io_ring_submit_lock(ctx, issue_flags);
		node = io_rsrc_node_lookup(&ctx->buf_table, req->buf_index);
		if (node) {
			io_req_assign_buf_node(req, node);
			ret = 0;
		}
		io_ring_submit_unlock(ctx, issue_flags);
	}
done:
	if (ret < 0)