Lines Matching refs:sg

14 	if (msg->sg.end > msg->sg.start &&  in sk_msg_try_coalesce_ok()
15 elem_first_coalesce < msg->sg.end) in sk_msg_try_coalesce_ok()
18 if (msg->sg.end < msg->sg.start && in sk_msg_try_coalesce_ok()
19 (elem_first_coalesce > msg->sg.start || in sk_msg_try_coalesce_ok()
20 elem_first_coalesce < msg->sg.end)) in sk_msg_try_coalesce_ok()
32 len -= msg->sg.size; in sk_msg_alloc()
46 i = msg->sg.end; in sk_msg_alloc()
48 sge = &msg->sg.data[i]; in sk_msg_alloc()
60 sge = &msg->sg.data[msg->sg.end]; in sk_msg_alloc()
68 msg->sg.size += use; in sk_msg_alloc()
80 int i = src->sg.start; in sk_msg_clone()
90 if (i == src->sg.end && off) in sk_msg_clone()
100 if (dst->sg.end) in sk_msg_clone()
101 sgd = sk_msg_elem(dst, dst->sg.end - 1); in sk_msg_clone()
107 dst->sg.size += sge_len; in sk_msg_clone()
119 if (i == src->sg.end && len) in sk_msg_clone()
130 int i = msg->sg.start; in sk_msg_return_zero()
147 } while (bytes && i != msg->sg.end); in sk_msg_return_zero()
148 msg->sg.start = i; in sk_msg_return_zero()
154 int i = msg->sg.start; in sk_msg_return()
157 struct scatterlist *sge = &msg->sg.data[i]; in sk_msg_return()
163 } while (i != msg->sg.end); in sk_msg_return()
189 while (msg->sg.size) { in __sk_msg_free()
190 msg->sg.size -= sge->length; in __sk_msg_free()
193 sk_msg_check_to_free(msg, i, msg->sg.size); in __sk_msg_free()
203 return __sk_msg_free(sk, msg, msg->sg.start, false); in sk_msg_free_nocharge()
209 return __sk_msg_free(sk, msg, msg->sg.start, true); in sk_msg_free()
217 u32 i = msg->sg.start; in __sk_msg_free_partial()
228 msg->sg.size -= bytes; in __sk_msg_free_partial()
232 msg->sg.size -= sge->length; in __sk_msg_free_partial()
238 msg->sg.start = i; in __sk_msg_free_partial()
255 int trim = msg->sg.size - len; in sk_msg_trim()
256 u32 i = msg->sg.end; in sk_msg_trim()
264 msg->sg.size = len; in sk_msg_trim()
265 while (msg->sg.data[i].length && in sk_msg_trim()
266 trim >= msg->sg.data[i].length) { in sk_msg_trim()
267 trim -= msg->sg.data[i].length; in sk_msg_trim()
274 msg->sg.data[i].length -= trim; in sk_msg_trim()
277 if (msg->sg.curr == i && msg->sg.copybreak > msg->sg.data[i].length) in sk_msg_trim()
278 msg->sg.copybreak = msg->sg.data[i].length; in sk_msg_trim()
281 msg->sg.end = i; in sk_msg_trim()
289 if (!msg->sg.size) { in sk_msg_trim()
290 msg->sg.curr = msg->sg.start; in sk_msg_trim()
291 msg->sg.copybreak = 0; in sk_msg_trim()
292 } else if (sk_msg_iter_dist(msg->sg.start, msg->sg.curr) >= in sk_msg_trim()
293 sk_msg_iter_dist(msg->sg.start, msg->sg.end)) { in sk_msg_trim()
295 msg->sg.curr = i; in sk_msg_trim()
296 msg->sg.copybreak = msg->sg.data[i].length; in sk_msg_trim()
309 orig = msg->sg.size; in sk_msg_zerocopy_from_iter()
327 msg->sg.size += copied; in sk_msg_zerocopy_from_iter()
331 sg_set_page(&msg->sg.data[msg->sg.end], in sk_msg_zerocopy_from_iter()
333 sg_unmark_end(&msg->sg.data[msg->sg.end]); in sk_msg_zerocopy_from_iter()
346 msg->sg.copybreak = 0; in sk_msg_zerocopy_from_iter()
347 msg->sg.curr = msg->sg.end; in sk_msg_zerocopy_from_iter()
354 iov_iter_revert(from, msg->sg.size - orig); in sk_msg_zerocopy_from_iter()
362 int ret = -ENOSPC, i = msg->sg.curr; in sk_msg_memcopy_from_iter()
370 if (msg->sg.copybreak >= sge->length) { in sk_msg_memcopy_from_iter()
371 msg->sg.copybreak = 0; in sk_msg_memcopy_from_iter()
373 if (i == msg->sg.end) in sk_msg_memcopy_from_iter()
378 buf_size = sge->length - msg->sg.copybreak; in sk_msg_memcopy_from_iter()
380 to = sg_virt(sge) + msg->sg.copybreak; in sk_msg_memcopy_from_iter()
381 msg->sg.copybreak += copy; in sk_msg_memcopy_from_iter()
393 msg->sg.copybreak = 0; in sk_msg_memcopy_from_iter()
395 } while (i != msg->sg.end); in sk_msg_memcopy_from_iter()
397 msg->sg.curr = i; in sk_msg_memcopy_from_iter()
418 i = msg_rx->sg.start; in sk_msg_recvmsg()
438 msg_rx->sg.size -= copy; in sk_msg_recvmsg()
456 } while (i != msg_rx->sg.end); in sk_msg_recvmsg()
465 msg_rx->sg.start = i; in sk_msg_recvmsg()
466 if (!sge->length && msg_rx->sg.start == msg_rx->sg.end) { in sk_msg_recvmsg()
525 num_sge = skb_to_sgvec(skb, msg->sg.data, off, len); in sk_psock_skb_ingress_enqueue()
530 msg->sg.start = 0; in sk_psock_skb_ingress_enqueue()
531 msg->sg.size = copied; in sk_psock_skb_ingress_enqueue()
532 msg->sg.end = num_sge; in sk_psock_skb_ingress_enqueue()