]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
io_uring/zcrx: move count check into zcrx_get_free_niov
authorPavel Begunkov <asml.silence@gmail.com>
Mon, 23 Mar 2026 12:43:58 +0000 (12:43 +0000)
committerJens Axboe <axboe@kernel.dk>
Wed, 1 Apr 2026 16:21:12 +0000 (10:21 -0600)
commit7df542a6657534694779948195cc4d36ace575b5
tree6a2106237e9770d5838b728b347b46a3beeb5519
parent898ad80d1207cbdb22b21bafb6de4adfd7627bd0
io_uring/zcrx: move count check into zcrx_get_free_niov

Instead of relying on the caller of __io_zcrx_get_free_niov() to check
that there are free niovs available (i.e. free_count > 0), move the
check into the function and return NULL if can't allocate. It
consolidates the free count checks, and it'll be easier to extend the
niov free list allocator in the future.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://patch.msgid.link/6df04a6b3a6170f86d4345da9864f238311163f9.1774261953.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/zcrx.c