Whamcloud - gitweb
LU-5319 mdc: manage number of modify RPCs in flight
[fs/lustre-release.git] / lustre / mdc / mdc_reint.c
index 3e5731a..31985a2 100644 (file)
 #include <lustre_fid.h>
 
 /* mdc_setattr does its own semaphore handling */
 #include <lustre_fid.h>
 
 /* mdc_setattr does its own semaphore handling */
-static int mdc_reint(struct ptlrpc_request *request,
-                     struct mdc_rpc_lock *rpc_lock,
-                     int level)
+static int mdc_reint(struct ptlrpc_request *request, int level)
 {
         int rc;
 
         request->rq_send_state = level;
 
 {
         int rc;
 
         request->rq_send_state = level;
 
-        mdc_get_rpc_lock(rpc_lock, NULL);
-        rc = ptlrpc_queue_wait(request);
-        mdc_put_rpc_lock(rpc_lock, NULL);
+       mdc_get_mod_rpc_slot(request, NULL);
+       rc = ptlrpc_queue_wait(request);
+       mdc_put_mod_rpc_slot(request, NULL);
         if (rc)
                 CDEBUG(D_INFO, "error in handling %d\n", rc);
         else if (!req_capsule_server_get(&request->rq_pill, &RMF_MDT_BODY)) {
         if (rc)
                 CDEBUG(D_INFO, "error in handling %d\n", rc);
         else if (!req_capsule_server_get(&request->rq_pill, &RMF_MDT_BODY)) {
@@ -106,8 +104,6 @@ int mdc_setattr(struct obd_export *exp, struct md_op_data *op_data,
 {
        struct list_head cancels = LIST_HEAD_INIT(cancels);
         struct ptlrpc_request *req;
 {
        struct list_head cancels = LIST_HEAD_INIT(cancels);
         struct ptlrpc_request *req;
-        struct mdc_rpc_lock *rpc_lock;
-        struct obd_device *obd = exp->exp_obd;
         int count = 0, rc;
         __u64 bits;
         ENTRY;
         int count = 0, rc;
         __u64 bits;
         ENTRY;
@@ -138,8 +134,6 @@ int mdc_setattr(struct obd_export *exp, struct md_op_data *op_data,
                RETURN(rc);
        }
 
                RETURN(rc);
        }
 
-        rpc_lock = obd->u.cli.cl_rpc_lock;
-
         if (op_data->op_attr.ia_valid & (ATTR_MTIME | ATTR_CTIME))
                 CDEBUG(D_INODE, "setting mtime "CFS_TIME_T
                        ", ctime "CFS_TIME_T"\n",
         if (op_data->op_attr.ia_valid & (ATTR_MTIME | ATTR_CTIME))
                 CDEBUG(D_INODE, "setting mtime "CFS_TIME_T
                        ", ctime "CFS_TIME_T"\n",
@@ -149,7 +143,7 @@ int mdc_setattr(struct obd_export *exp, struct md_op_data *op_data,
 
         ptlrpc_request_set_replen(req);
 
 
         ptlrpc_request_set_replen(req);
 
-        rc = mdc_reint(req, rpc_lock, LUSTRE_IMP_FULL);
+       rc = mdc_reint(req, LUSTRE_IMP_FULL);
        if (rc == -ERESTARTSYS)
                 rc = 0;
 
        if (rc == -ERESTARTSYS)
                 rc = 0;
 
@@ -229,7 +223,7 @@ rebuild:
         }
         level = LUSTRE_IMP_FULL;
  resend:
         }
         level = LUSTRE_IMP_FULL;
  resend:
-        rc = mdc_reint(req, exp->exp_obd->u.cli.cl_rpc_lock, level);
+       rc = mdc_reint(req, level);
 
         /* Resend if we were told to. */
         if (rc == -ERESTARTSYS) {
 
         /* Resend if we were told to. */
         if (rc == -ERESTARTSYS) {
@@ -302,7 +296,7 @@ int mdc_unlink(struct obd_export *exp, struct md_op_data *op_data,
 
         *request = req;
 
 
         *request = req;
 
-        rc = mdc_reint(req, obd->u.cli.cl_rpc_lock, LUSTRE_IMP_FULL);
+       rc = mdc_reint(req, LUSTRE_IMP_FULL);
         if (rc == -ERESTARTSYS)
                 rc = 0;
         RETURN(rc);
         if (rc == -ERESTARTSYS)
                 rc = 0;
         RETURN(rc);
@@ -312,7 +306,6 @@ int mdc_link(struct obd_export *exp, struct md_op_data *op_data,
              struct ptlrpc_request **request)
 {
        struct list_head cancels = LIST_HEAD_INIT(cancels);
              struct ptlrpc_request **request)
 {
        struct list_head cancels = LIST_HEAD_INIT(cancels);
-        struct obd_device *obd = exp->exp_obd;
         struct ptlrpc_request *req;
         int count = 0, rc;
         ENTRY;
         struct ptlrpc_request *req;
         int count = 0, rc;
         ENTRY;
@@ -346,7 +339,7 @@ int mdc_link(struct obd_export *exp, struct md_op_data *op_data,
         mdc_link_pack(req, op_data);
         ptlrpc_request_set_replen(req);
 
         mdc_link_pack(req, op_data);
         ptlrpc_request_set_replen(req);
 
-        rc = mdc_reint(req, obd->u.cli.cl_rpc_lock, LUSTRE_IMP_FULL);
+       rc = mdc_reint(req, LUSTRE_IMP_FULL);
         *request = req;
         if (rc == -ERESTARTSYS)
                 rc = 0;
         *request = req;
         if (rc == -ERESTARTSYS)
                 rc = 0;
@@ -410,7 +403,7 @@ int mdc_rename(struct obd_export *exp, struct md_op_data *op_data,
                             obd->u.cli.cl_default_mds_easize);
        ptlrpc_request_set_replen(req);
 
                             obd->u.cli.cl_default_mds_easize);
        ptlrpc_request_set_replen(req);
 
-        rc = mdc_reint(req, obd->u.cli.cl_rpc_lock, LUSTRE_IMP_FULL);
+       rc = mdc_reint(req, LUSTRE_IMP_FULL);
         *request = req;
         if (rc == -ERESTARTSYS)
                 rc = 0;
         *request = req;
         if (rc == -ERESTARTSYS)
                 rc = 0;