Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring/zcrx: move io_zcrx_iov_page

We'll need io_zcrx_iov_page at the top to keep offset calculations
closer together, move it there.

Reviewed-by: David Wei <dw@davidwei.uk>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/575617033a8b84a5985c7eb760b7121efdbe7e56.1745141261.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Pavel Begunkov and committed by
Jens Axboe
a79154ae 37d26edd

+14 -14
+14 -14
io_uring/zcrx.c
··· 31 31 return pp->mp_priv; 32 32 } 33 33 34 + static inline struct io_zcrx_area *io_zcrx_iov_to_area(const struct net_iov *niov) 35 + { 36 + struct net_iov_area *owner = net_iov_owner(niov); 37 + 38 + return container_of(owner, struct io_zcrx_area, nia); 39 + } 40 + 41 + static inline struct page *io_zcrx_iov_page(const struct net_iov *niov) 42 + { 43 + struct io_zcrx_area *area = io_zcrx_iov_to_area(niov); 44 + 45 + return area->pages[net_iov_idx(niov)]; 46 + } 47 + 34 48 #define IO_DMA_ATTR (DMA_ATTR_SKIP_CPU_SYNC | DMA_ATTR_WEAK_ORDERING) 35 49 36 50 static void __io_zcrx_unmap_area(struct io_zcrx_ifq *ifq, ··· 132 118 133 119 static const struct memory_provider_ops io_uring_pp_zc_ops; 134 120 135 - static inline struct io_zcrx_area *io_zcrx_iov_to_area(const struct net_iov *niov) 136 - { 137 - struct net_iov_area *owner = net_iov_owner(niov); 138 - 139 - return container_of(owner, struct io_zcrx_area, nia); 140 - } 141 - 142 121 static inline atomic_t *io_get_user_counter(struct net_iov *niov) 143 122 { 144 123 struct io_zcrx_area *area = io_zcrx_iov_to_area(niov); ··· 152 145 static void io_zcrx_get_niov_uref(struct net_iov *niov) 153 146 { 154 147 atomic_inc(io_get_user_counter(niov)); 155 - } 156 - 157 - static inline struct page *io_zcrx_iov_page(const struct net_iov *niov) 158 - { 159 - struct io_zcrx_area *area = io_zcrx_iov_to_area(niov); 160 - 161 - return area->pages[net_iov_idx(niov)]; 162 148 } 163 149 164 150 static int io_allocate_rbuf_ring(struct io_zcrx_ifq *ifq,