Whamcloud - gitweb
LU-13004 lnet: always pass struct lnet_md by reference.
[fs/lustre-release.git] / lustre / ptlrpc / niobuf.c
index a89b526..43b9db0 100644 (file)
@@ -76,7 +76,7 @@ static int ptl_send_buf(struct lnet_handle_md *mdh, void *base, int len,
                ack = LNET_NOACK_REQ;
        }
 
-       rc = LNetMDBind (md, LNET_UNLINK, mdh);
+       rc = LNetMDBind(&md, LNET_UNLINK, mdh);
        if (unlikely(rc != 0)) {
                CERROR ("LNetMDBind failed: %d\n", rc);
                LASSERT (rc == -ENOMEM);
@@ -208,7 +208,7 @@ int ptlrpc_start_bulk_transfer(struct ptlrpc_bulk_desc *desc)
                 * page-aligned. Otherwise we'd have to send client bulk
                 * sizes over and split server buffer accordingly */
                ptlrpc_fill_bulk_md(&md, desc, posted_md);
-               rc = LNetMDBind(md, LNET_UNLINK, &desc->bd_mds[posted_md]);
+               rc = LNetMDBind(&md, LNET_UNLINK, &desc->bd_mds[posted_md]);
                if (rc != 0) {
                        CERROR("%s: LNetMDBind failed for MD %u: rc = %d\n",
                               exp->exp_obd->obd_name, posted_md, rc);
@@ -393,7 +393,7 @@ int ptlrpc_register_bulk(struct ptlrpc_request *req)
                percpu_ref_get(&ptlrpc_pending);
 
                /* About to let the network at it... */
-               rc = LNetMDAttach(me, md, LNET_UNLINK,
+               rc = LNetMDAttach(me, &md, LNET_UNLINK,
                                  &desc->bd_mds[posted_md]);
                if (rc != 0) {
                        CERROR("%s: LNetMDAttach failed x%llu/%d: rc = %d\n",
@@ -867,7 +867,7 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply)
 
                /* We must see the unlink callback to set rq_reply_unlinked,
                 * so we can't auto-unlink */
-               rc = LNetMDAttach(reply_me, reply_md, LNET_RETAIN,
+               rc = LNetMDAttach(reply_me, &reply_md, LNET_RETAIN,
                                  &request->rq_reply_md_h);
                if (rc != 0) {
                        CERROR("LNetMDAttach failed: %d\n", rc);
@@ -991,7 +991,7 @@ int ptlrpc_register_rqbd(struct ptlrpc_request_buffer_desc *rqbd)
        md.user_ptr  = &rqbd->rqbd_cbid;
        md.handler   = ptlrpc_handler;
 
-       rc = LNetMDAttach(me, md, LNET_UNLINK, &rqbd->rqbd_md_h);
+       rc = LNetMDAttach(me, &md, LNET_UNLINK, &rqbd->rqbd_md_h);
        if (rc == 0) {
                percpu_ref_get(&ptlrpc_pending);
                return 0;