Commit 7df542a
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>1 parent 898ad80 commit 7df542a
1 file changed
Lines changed: 21 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
590 | 590 | | |
591 | 591 | | |
592 | 592 | | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
593 | 606 | | |
594 | 607 | | |
595 | 608 | | |
| |||
903 | 916 | | |
904 | 917 | | |
905 | 918 | | |
906 | | - | |
907 | | - | |
908 | | - | |
909 | | - | |
910 | | - | |
911 | | - | |
912 | | - | |
913 | | - | |
914 | | - | |
915 | | - | |
916 | 919 | | |
917 | 920 | | |
918 | 921 | | |
| |||
1054 | 1057 | | |
1055 | 1058 | | |
1056 | 1059 | | |
1057 | | - | |
1058 | | - | |
1059 | | - | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
1060 | 1063 | | |
| 1064 | + | |
| 1065 | + | |
1061 | 1066 | | |
1062 | 1067 | | |
| 1068 | + | |
1063 | 1069 | | |
1064 | 1070 | | |
1065 | 1071 | | |
| |||
1284 | 1290 | | |
1285 | 1291 | | |
1286 | 1292 | | |
1287 | | - | |
1288 | | - | |
1289 | | - | |
1290 | | - | |
| 1293 | + | |
| 1294 | + | |
1291 | 1295 | | |
1292 | 1296 | | |
1293 | 1297 | | |
| |||
0 commit comments