Lines Matching refs:ctxt
57 struct svc_rdma_rw_ctxt *ctxt; in svc_rdma_get_rw_ctxt() local
61 ctxt = svc_rdma_next_ctxt(&rdma->sc_rw_ctxts); in svc_rdma_get_rw_ctxt()
62 if (ctxt) { in svc_rdma_get_rw_ctxt()
63 list_del(&ctxt->rw_list); in svc_rdma_get_rw_ctxt()
67 ctxt = kmalloc(struct_size(ctxt, rw_first_sgl, SG_CHUNK_SIZE), in svc_rdma_get_rw_ctxt()
69 if (!ctxt) in svc_rdma_get_rw_ctxt()
71 INIT_LIST_HEAD(&ctxt->rw_list); in svc_rdma_get_rw_ctxt()
74 ctxt->rw_sg_table.sgl = ctxt->rw_first_sgl; in svc_rdma_get_rw_ctxt()
75 if (sg_alloc_table_chained(&ctxt->rw_sg_table, sges, in svc_rdma_get_rw_ctxt()
76 ctxt->rw_sg_table.sgl, in svc_rdma_get_rw_ctxt()
78 kfree(ctxt); in svc_rdma_get_rw_ctxt()
79 ctxt = NULL; in svc_rdma_get_rw_ctxt()
82 return ctxt; in svc_rdma_get_rw_ctxt()
86 struct svc_rdma_rw_ctxt *ctxt) in svc_rdma_put_rw_ctxt() argument
88 sg_free_table_chained(&ctxt->rw_sg_table, SG_CHUNK_SIZE); in svc_rdma_put_rw_ctxt()
91 list_add(&ctxt->rw_list, &rdma->sc_rw_ctxts); in svc_rdma_put_rw_ctxt()
102 struct svc_rdma_rw_ctxt *ctxt; in svc_rdma_destroy_rw_ctxts() local
104 while ((ctxt = svc_rdma_next_ctxt(&rdma->sc_rw_ctxts)) != NULL) { in svc_rdma_destroy_rw_ctxts()
105 list_del(&ctxt->rw_list); in svc_rdma_destroy_rw_ctxts()
106 kfree(ctxt); in svc_rdma_destroy_rw_ctxts()
139 struct svc_rdma_rw_ctxt *ctxt; in svc_rdma_cc_release() local
141 while ((ctxt = svc_rdma_next_ctxt(&cc->cc_rwctxts)) != NULL) { in svc_rdma_cc_release()
142 list_del(&ctxt->rw_list); in svc_rdma_cc_release()
144 rdma_rw_ctx_destroy(&ctxt->rw_ctx, rdma->sc_qp, in svc_rdma_cc_release()
145 rdma->sc_port_num, ctxt->rw_sg_table.sgl, in svc_rdma_cc_release()
146 ctxt->rw_nents, dir); in svc_rdma_cc_release()
147 svc_rdma_put_rw_ctxt(rdma, ctxt); in svc_rdma_cc_release()
314 struct svc_rdma_rw_ctxt *ctxt; in svc_rdma_post_chunk_ctxt() local
316 ctxt = list_entry(tmp, struct svc_rdma_rw_ctxt, rw_list); in svc_rdma_post_chunk_ctxt()
317 first_wr = rdma_rw_ctx_wrs(&ctxt->rw_ctx, rdma->sc_qp, in svc_rdma_post_chunk_ctxt()
355 struct svc_rdma_rw_ctxt *ctxt) in svc_rdma_vec_to_sg() argument
357 struct scatterlist *sg = ctxt->rw_sg_table.sgl; in svc_rdma_vec_to_sg()
362 ctxt->rw_nents = 1; in svc_rdma_vec_to_sg()
369 struct svc_rdma_rw_ctxt *ctxt) in svc_rdma_pagelist_to_sg() argument
381 sg = ctxt->rw_sg_table.sgl; in svc_rdma_pagelist_to_sg()
395 ctxt->rw_nents = sge_no; in svc_rdma_pagelist_to_sg()
405 struct svc_rdma_rw_ctxt *ctxt), in svc_rdma_build_writes() argument
410 struct svc_rdma_rw_ctxt *ctxt; in svc_rdma_build_writes() local
429 ctxt = svc_rdma_get_rw_ctxt(rdma, in svc_rdma_build_writes()
431 if (!ctxt) in svc_rdma_build_writes()
434 constructor(info, write_len, ctxt); in svc_rdma_build_writes()
435 ret = rdma_rw_ctx_init(&ctxt->rw_ctx, rdma->sc_qp, in svc_rdma_build_writes()
436 rdma->sc_port_num, ctxt->rw_sg_table.sgl, in svc_rdma_build_writes()
437 ctxt->rw_nents, 0, seg_offset, in svc_rdma_build_writes()
443 list_add(&ctxt->rw_list, &cc->cc_rwctxts); in svc_rdma_build_writes()
467 svc_rdma_put_rw_ctxt(rdma, ctxt); in svc_rdma_build_writes()
605 struct svc_rdma_rw_ctxt *ctxt; in svc_rdma_build_read_segment() local
611 ctxt = svc_rdma_get_rw_ctxt(cc->cc_rdma, sge_no); in svc_rdma_build_read_segment()
612 if (!ctxt) in svc_rdma_build_read_segment()
614 ctxt->rw_nents = sge_no; in svc_rdma_build_read_segment()
616 sg = ctxt->rw_sg_table.sgl; in svc_rdma_build_read_segment()
617 for (sge_no = 0; sge_no < ctxt->rw_nents; sge_no++) { in svc_rdma_build_read_segment()
643 ret = rdma_rw_ctx_init(&ctxt->rw_ctx, cc->cc_rdma->sc_qp, in svc_rdma_build_read_segment()
645 ctxt->rw_sg_table.sgl, ctxt->rw_nents, in svc_rdma_build_read_segment()
650 list_add(&ctxt->rw_list, &cc->cc_rwctxts); in svc_rdma_build_read_segment()
664 svc_rdma_put_rw_ctxt(cc->cc_rdma, ctxt); in svc_rdma_build_read_segment()