Lines Matching refs:ctxt
55 struct svc_rdma_rw_ctxt *ctxt; in svc_rdma_get_rw_ctxt() local
59 ctxt = svc_rdma_next_ctxt(&rdma->sc_rw_ctxts); in svc_rdma_get_rw_ctxt()
60 if (ctxt) { in svc_rdma_get_rw_ctxt()
61 list_del(&ctxt->rw_list); in svc_rdma_get_rw_ctxt()
65 ctxt = kmalloc(struct_size(ctxt, rw_first_sgl, SG_CHUNK_SIZE), in svc_rdma_get_rw_ctxt()
67 if (!ctxt) in svc_rdma_get_rw_ctxt()
69 INIT_LIST_HEAD(&ctxt->rw_list); in svc_rdma_get_rw_ctxt()
72 ctxt->rw_sg_table.sgl = ctxt->rw_first_sgl; in svc_rdma_get_rw_ctxt()
73 if (sg_alloc_table_chained(&ctxt->rw_sg_table, sges, in svc_rdma_get_rw_ctxt()
74 ctxt->rw_sg_table.sgl, in svc_rdma_get_rw_ctxt()
77 return ctxt; in svc_rdma_get_rw_ctxt()
80 kfree(ctxt); in svc_rdma_get_rw_ctxt()
87 struct svc_rdma_rw_ctxt *ctxt) in svc_rdma_put_rw_ctxt() argument
89 sg_free_table_chained(&ctxt->rw_sg_table, SG_CHUNK_SIZE); in svc_rdma_put_rw_ctxt()
92 list_add(&ctxt->rw_list, &rdma->sc_rw_ctxts); in svc_rdma_put_rw_ctxt()
103 struct svc_rdma_rw_ctxt *ctxt; in svc_rdma_destroy_rw_ctxts() local
105 while ((ctxt = svc_rdma_next_ctxt(&rdma->sc_rw_ctxts)) != NULL) { in svc_rdma_destroy_rw_ctxts()
106 list_del(&ctxt->rw_list); in svc_rdma_destroy_rw_ctxts()
107 kfree(ctxt); in svc_rdma_destroy_rw_ctxts()
123 struct svc_rdma_rw_ctxt *ctxt, in svc_rdma_rw_ctx_init() argument
129 ret = rdma_rw_ctx_init(&ctxt->rw_ctx, rdma->sc_qp, rdma->sc_port_num, in svc_rdma_rw_ctx_init()
130 ctxt->rw_sg_table.sgl, ctxt->rw_nents, in svc_rdma_rw_ctx_init()
133 svc_rdma_put_rw_ctxt(rdma, ctxt); in svc_rdma_rw_ctx_init()
134 trace_svcrdma_dma_map_rw_err(rdma, ctxt->rw_nents, ret); in svc_rdma_rw_ctx_init()
176 struct svc_rdma_rw_ctxt *ctxt; in svc_rdma_cc_release() local
178 while ((ctxt = svc_rdma_next_ctxt(&cc->cc_rwctxts)) != NULL) { in svc_rdma_cc_release()
179 list_del(&ctxt->rw_list); in svc_rdma_cc_release()
181 rdma_rw_ctx_destroy(&ctxt->rw_ctx, rdma->sc_qp, in svc_rdma_cc_release()
182 rdma->sc_port_num, ctxt->rw_sg_table.sgl, in svc_rdma_cc_release()
183 ctxt->rw_nents, dir); in svc_rdma_cc_release()
184 svc_rdma_put_rw_ctxt(rdma, ctxt); in svc_rdma_cc_release()
350 struct svc_rdma_rw_ctxt *ctxt; in svc_rdma_post_chunk_ctxt() local
352 ctxt = list_entry(tmp, struct svc_rdma_rw_ctxt, rw_list); in svc_rdma_post_chunk_ctxt()
353 first_wr = rdma_rw_ctx_wrs(&ctxt->rw_ctx, rdma->sc_qp, in svc_rdma_post_chunk_ctxt()
391 struct svc_rdma_rw_ctxt *ctxt) in svc_rdma_vec_to_sg() argument
393 struct scatterlist *sg = ctxt->rw_sg_table.sgl; in svc_rdma_vec_to_sg()
398 ctxt->rw_nents = 1; in svc_rdma_vec_to_sg()
405 struct svc_rdma_rw_ctxt *ctxt) in svc_rdma_pagelist_to_sg() argument
417 sg = ctxt->rw_sg_table.sgl; in svc_rdma_pagelist_to_sg()
431 ctxt->rw_nents = sge_no; in svc_rdma_pagelist_to_sg()
441 struct svc_rdma_rw_ctxt *ctxt), in svc_rdma_build_writes() argument
446 struct svc_rdma_rw_ctxt *ctxt; in svc_rdma_build_writes() local
463 ctxt = svc_rdma_get_rw_ctxt(rdma, in svc_rdma_build_writes()
465 if (!ctxt) in svc_rdma_build_writes()
468 constructor(info, write_len, ctxt); in svc_rdma_build_writes()
469 ret = svc_rdma_rw_ctx_init(rdma, ctxt, offset, handle, in svc_rdma_build_writes()
476 list_add(&ctxt->rw_list, &cc->cc_rwctxts); in svc_rdma_build_writes()
635 struct svc_rdma_rw_ctxt *ctxt; in svc_rdma_build_read_segment() local
641 ctxt = svc_rdma_get_rw_ctxt(cc->cc_rdma, sge_no); in svc_rdma_build_read_segment()
642 if (!ctxt) in svc_rdma_build_read_segment()
644 ctxt->rw_nents = sge_no; in svc_rdma_build_read_segment()
646 sg = ctxt->rw_sg_table.sgl; in svc_rdma_build_read_segment()
647 for (sge_no = 0; sge_no < ctxt->rw_nents; sge_no++) { in svc_rdma_build_read_segment()
673 ret = svc_rdma_rw_ctx_init(cc->cc_rdma, ctxt, offset, rkey, in svc_rdma_build_read_segment()
678 list_add(&ctxt->rw_list, &cc->cc_rwctxts); in svc_rdma_build_read_segment()