]> git.ipfire.org Git - thirdparty/linux.git/blobdiff - net/sunrpc/xprtrdma/svc_rdma_rw.c
scsi: lib/sg_pool.c: improve APIs for allocating sg pool
[thirdparty/linux.git] / net / sunrpc / xprtrdma / svc_rdma_rw.c
index 2121c9b4d27567201c2b13704e917f1c2b05f141..48fe3b16b0d9c7903156e19810a5f8909312a7ad 100644 (file)
@@ -73,7 +73,8 @@ svc_rdma_get_rw_ctxt(struct svcxprt_rdma *rdma, unsigned int sges)
 
        ctxt->rw_sg_table.sgl = ctxt->rw_first_sgl;
        if (sg_alloc_table_chained(&ctxt->rw_sg_table, sges,
-                                  ctxt->rw_sg_table.sgl)) {
+                                  ctxt->rw_sg_table.sgl,
+                                  SG_CHUNK_SIZE)) {
                kfree(ctxt);
                ctxt = NULL;
        }
@@ -84,7 +85,7 @@ out:
 static void svc_rdma_put_rw_ctxt(struct svcxprt_rdma *rdma,
                                 struct svc_rdma_rw_ctxt *ctxt)
 {
-       sg_free_table_chained(&ctxt->rw_sg_table, true);
+       sg_free_table_chained(&ctxt->rw_sg_table, SG_CHUNK_SIZE);
 
        spin_lock(&rdma->sc_rw_ctxt_lock);
        list_add(&ctxt->rw_list, &rdma->sc_rw_ctxts);