Lines Matching refs:ctxt
56 struct svc_rdma_rw_ctxt *ctxt; in svc_rdma_get_rw_ctxt() local
63 ctxt = llist_entry(node, struct svc_rdma_rw_ctxt, rw_node); in svc_rdma_get_rw_ctxt()
65 ctxt = kmalloc_node(struct_size(ctxt, rw_first_sgl, SG_CHUNK_SIZE), in svc_rdma_get_rw_ctxt()
67 if (!ctxt) in svc_rdma_get_rw_ctxt()
70 INIT_LIST_HEAD(&ctxt->rw_list); in svc_rdma_get_rw_ctxt()
73 ctxt->rw_sg_table.sgl = ctxt->rw_first_sgl; in svc_rdma_get_rw_ctxt()
74 if (sg_alloc_table_chained(&ctxt->rw_sg_table, sges, in svc_rdma_get_rw_ctxt()
75 ctxt->rw_sg_table.sgl, in svc_rdma_get_rw_ctxt()
78 return ctxt; in svc_rdma_get_rw_ctxt()
81 kfree(ctxt); in svc_rdma_get_rw_ctxt()
87 static void __svc_rdma_put_rw_ctxt(struct svc_rdma_rw_ctxt *ctxt, in __svc_rdma_put_rw_ctxt() argument
90 sg_free_table_chained(&ctxt->rw_sg_table, SG_CHUNK_SIZE); in __svc_rdma_put_rw_ctxt()
91 llist_add(&ctxt->rw_node, list); in __svc_rdma_put_rw_ctxt()
95 struct svc_rdma_rw_ctxt *ctxt) in svc_rdma_put_rw_ctxt() argument
97 __svc_rdma_put_rw_ctxt(ctxt, &rdma->sc_rw_ctxts); in svc_rdma_put_rw_ctxt()
107 struct svc_rdma_rw_ctxt *ctxt; in svc_rdma_destroy_rw_ctxts() local
111 ctxt = llist_entry(node, struct svc_rdma_rw_ctxt, rw_node); in svc_rdma_destroy_rw_ctxts()
112 kfree(ctxt); in svc_rdma_destroy_rw_ctxts()
128 struct svc_rdma_rw_ctxt *ctxt, in svc_rdma_rw_ctx_init() argument
134 ret = rdma_rw_ctx_init(&ctxt->rw_ctx, rdma->sc_qp, rdma->sc_port_num, in svc_rdma_rw_ctx_init()
135 ctxt->rw_sg_table.sgl, ctxt->rw_nents, in svc_rdma_rw_ctx_init()
138 svc_rdma_put_rw_ctxt(rdma, ctxt); in svc_rdma_rw_ctx_init()
139 trace_svcrdma_dma_map_rw_err(rdma, ctxt->rw_nents, ret); in svc_rdma_rw_ctx_init()
190 struct svc_rdma_rw_ctxt *ctxt; in svc_rdma_cc_release() local
196 while ((ctxt = svc_rdma_next_ctxt(&cc->cc_rwctxts)) != NULL) { in svc_rdma_cc_release()
197 list_del(&ctxt->rw_list); in svc_rdma_cc_release()
199 rdma_rw_ctx_destroy(&ctxt->rw_ctx, rdma->sc_qp, in svc_rdma_cc_release()
200 rdma->sc_port_num, ctxt->rw_sg_table.sgl, in svc_rdma_cc_release()
201 ctxt->rw_nents, dir); in svc_rdma_cc_release()
202 __svc_rdma_put_rw_ctxt(ctxt, &free); in svc_rdma_cc_release()
204 ctxt->rw_node.next = first; in svc_rdma_cc_release()
205 first = &ctxt->rw_node; in svc_rdma_cc_release()
380 struct svc_rdma_rw_ctxt *ctxt; in svc_rdma_post_chunk_ctxt() local
382 ctxt = list_entry(tmp, struct svc_rdma_rw_ctxt, rw_list); in svc_rdma_post_chunk_ctxt()
383 first_wr = rdma_rw_ctx_wrs(&ctxt->rw_ctx, rdma->sc_qp, in svc_rdma_post_chunk_ctxt()
422 struct svc_rdma_rw_ctxt *ctxt) in svc_rdma_vec_to_sg() argument
424 struct scatterlist *sg = ctxt->rw_sg_table.sgl; in svc_rdma_vec_to_sg()
429 ctxt->rw_nents = 1; in svc_rdma_vec_to_sg()
436 struct svc_rdma_rw_ctxt *ctxt) in svc_rdma_pagelist_to_sg() argument
448 sg = ctxt->rw_sg_table.sgl; in svc_rdma_pagelist_to_sg()
462 ctxt->rw_nents = sge_no; in svc_rdma_pagelist_to_sg()
472 struct svc_rdma_rw_ctxt *ctxt), in svc_rdma_build_writes() argument
478 struct svc_rdma_rw_ctxt *ctxt; in svc_rdma_build_writes() local
492 ctxt = svc_rdma_get_rw_ctxt(rdma, in svc_rdma_build_writes()
494 if (!ctxt) in svc_rdma_build_writes()
497 constructor(info, write_len, ctxt); in svc_rdma_build_writes()
499 ret = svc_rdma_rw_ctx_init(rdma, ctxt, offset, seg->rs_handle, in svc_rdma_build_writes()
505 list_add(&ctxt->rw_list, &cc->cc_rwctxts); in svc_rdma_build_writes()
712 struct svc_rdma_rw_ctxt *ctxt; in svc_rdma_build_read_segment() local
718 ctxt = svc_rdma_get_rw_ctxt(cc->cc_rdma, sge_no); in svc_rdma_build_read_segment()
719 if (!ctxt) in svc_rdma_build_read_segment()
721 ctxt->rw_nents = sge_no; in svc_rdma_build_read_segment()
723 sg = ctxt->rw_sg_table.sgl; in svc_rdma_build_read_segment()
724 for (sge_no = 0; sge_no < ctxt->rw_nents; sge_no++) { in svc_rdma_build_read_segment()
748 ret = svc_rdma_rw_ctx_init(cc->cc_rdma, ctxt, segment->rs_offset, in svc_rdma_build_read_segment()
754 list_add(&ctxt->rw_list, &cc->cc_rwctxts); in svc_rdma_build_read_segment()