Lines Matching refs:sg
418 sg_init_table(sgl->sg, npages + 1); in af_alg_make_sg()
423 sg_set_page(sgl->sg + i, sgl->pages[i], plen, off); in af_alg_make_sg()
428 sg_mark_end(sgl->sg + npages - 1); in af_alg_make_sg()
438 sg_unmark_end(sgl_prev->sg + sgl_prev->npages - 1); in af_alg_link_sg()
439 sg_chain(sgl_prev->sg, sgl_prev->npages + 1, sgl_new->sg); in af_alg_link_sg()
502 struct scatterlist *sg = NULL; in af_alg_alloc_tsgl() local
506 sg = sgl->sg; in af_alg_alloc_tsgl()
508 if (!sg || sgl->cur >= MAX_SGL_ENTS) { in af_alg_alloc_tsgl()
510 struct_size(sgl, sg, (MAX_SGL_ENTS + 1)), in af_alg_alloc_tsgl()
515 sg_init_table(sgl->sg, MAX_SGL_ENTS + 1); in af_alg_alloc_tsgl()
518 if (sg) in af_alg_alloc_tsgl()
519 sg_chain(sg, MAX_SGL_ENTS + 1, sgl->sg); in af_alg_alloc_tsgl()
550 const struct scatterlist *sg = sgl->sg; in af_alg_count_tsgl() local
556 if (offset >= sg[i].length) { in af_alg_count_tsgl()
557 offset -= sg[i].length; in af_alg_count_tsgl()
558 bytes -= sg[i].length; in af_alg_count_tsgl()
562 bytes_count = sg[i].length - offset; in af_alg_count_tsgl()
600 struct scatterlist *sg; in af_alg_pull_tsgl() local
606 sg = sgl->sg; in af_alg_pull_tsgl()
609 size_t plen = min_t(size_t, used, sg[i].length); in af_alg_pull_tsgl()
610 struct page *page = sg_page(sg + i); in af_alg_pull_tsgl()
628 sg[i].offset + dst_offset); in af_alg_pull_tsgl()
634 sg[i].length -= plen; in af_alg_pull_tsgl()
635 sg[i].offset += plen; in af_alg_pull_tsgl()
640 if (sg[i].length) in af_alg_pull_tsgl()
644 sg_assign_page(sg + i, NULL); in af_alg_pull_tsgl()
648 sock_kfree_s(sk, sgl, struct_size(sgl, sg, MAX_SGL_ENTS + 1)); in af_alg_pull_tsgl()
669 struct scatterlist *sg; in af_alg_free_areq_sgls() local
682 for_each_sg(tsgl, sg, areq->tsgl_entries, i) { in af_alg_free_areq_sgls()
683 if (!sg_page(sg)) in af_alg_free_areq_sgls()
685 put_page(sg_page(sg)); in af_alg_free_areq_sgls()
886 struct scatterlist *sg; in af_alg_sendmsg() local
894 sg = sgl->sg + sgl->cur - 1; in af_alg_sendmsg()
896 PAGE_SIZE - sg->offset - sg->length); in af_alg_sendmsg()
898 err = memcpy_from_msg(page_address(sg_page(sg)) + in af_alg_sendmsg()
899 sg->offset + sg->length, in af_alg_sendmsg()
904 sg->length += len; in af_alg_sendmsg()
905 ctx->merge = (sg->offset + sg->length) & in af_alg_sendmsg()
929 sg = sgl->sg; in af_alg_sendmsg()
931 sg_unmark_end(sg + sgl->cur - 1); in af_alg_sendmsg()
938 sg_assign_page(sg + i, alloc_page(GFP_KERNEL)); in af_alg_sendmsg()
939 if (!sg_page(sg + i)) { in af_alg_sendmsg()
944 err = memcpy_from_msg(page_address(sg_page(sg + i)), in af_alg_sendmsg()
947 __free_page(sg_page(sg + i)); in af_alg_sendmsg()
948 sg_assign_page(sg + i, NULL); in af_alg_sendmsg()
952 sg[i].length = plen; in af_alg_sendmsg()
961 sg_mark_end(sg + sgl->cur - 1); in af_alg_sendmsg()
1021 sg_unmark_end(sgl->sg + sgl->cur - 1); in af_alg_sendpage()
1023 sg_mark_end(sgl->sg + sgl->cur); in af_alg_sendpage()
1026 sg_set_page(sgl->sg + sgl->cur, page, size, offset); in af_alg_sendpage()