Whamcloud - gitweb
LU-5319 mdc: manage number of modify RPCs in flight
[fs/lustre-release.git] / lustre / mdc / mdc_locks.c
index 1866103..d93146e 100644 (file)
@@ -828,14 +828,15 @@ resend:
                 req->rq_sent = cfs_time_current_sec() + resends;
         }
 
-        /* It is important to obtain rpc_lock first (if applicable), so that
-         * threads that are serialised with rpc_lock are not polluting our
-         * rpcs in flight counter. We do not do flock request limiting, though*/
-        if (it) {
-                mdc_get_rpc_lock(obddev->u.cli.cl_rpc_lock, it);
+       /* It is important to obtain modify RPC slot first (if applicable), so
+        * that threads that are waiting for a modify RPC slot are not polluting
+        * our rpcs in flight counter.
+        * We do not do flock request limiting, though */
+       if (it) {
+               mdc_get_mod_rpc_slot(req, it);
                rc = obd_get_request_slot(&obddev->u.cli);
-                if (rc != 0) {
-                        mdc_put_rpc_lock(obddev->u.cli.cl_rpc_lock, it);
+               if (rc != 0) {
+                       mdc_put_mod_rpc_slot(req, it);
                         mdc_clear_replay_flag(req, 0);
                         ptlrpc_req_finished(req);
                         RETURN(rc);
@@ -861,7 +862,7 @@ resend:
        }
 
        obd_put_request_slot(&obddev->u.cli);
-       mdc_put_rpc_lock(obddev->u.cli.cl_rpc_lock, it);
+       mdc_put_mod_rpc_slot(req, it);
 
        if (rc < 0) {
                CDEBUG(D_INFO, "%s: ldlm_cli_enqueue failed: rc = %d\n",