Whamcloud - gitweb
use mdc RPC lock to queue the seq/fld requests, except FLD_LOOKUP
authortappro <tappro>
Sat, 7 Oct 2006 15:05:31 +0000 (15:05 +0000)
committertappro <tappro>
Sat, 7 Oct 2006 15:05:31 +0000 (15:05 +0000)
lustre/fid/fid_request.c
lustre/fld/fld_request.c
lustre/include/lustre_mdc.h
lustre/mdc/mdc_internal.h

index 96b2298..2340293 100644 (file)
@@ -45,6 +45,8 @@
 #include <obd_support.h>
 #include <lustre_req_layout.h>
 #include <lustre_fid.h>
+/* mdc RPC locks */
+#include <lustre_mdc.h>
 #include "fid_internal.h"
 
 static int seq_client_rpc(struct lu_client_seq *seq,
@@ -90,7 +92,10 @@ static int seq_client_rpc(struct lu_client_seq *seq,
                         SEQ_CONTROLLER_PORTAL : SEQ_DATA_PORTAL;
         }
 
+        mdc_get_rpc_lock(exp->exp_obd->u.cli.cl_rpc_lock, NULL);
         rc = ptlrpc_queue_wait(req);
+        mdc_put_rpc_lock(exp->exp_obd->u.cli.cl_rpc_lock, NULL);
+
         if (rc)
                 GOTO(out_req, rc);
 
index 1933b27..2cfb56d 100644 (file)
@@ -50,6 +50,7 @@
 #include <md_object.h>
 #include <lustre_req_layout.h>
 #include <lustre_fld.h>
+#include <lustre_mdc.h>
 #include "fld_internal.h"
 
 static int fld_rrb_hash(struct lu_client_fld *fld,
@@ -392,7 +393,11 @@ static int fld_client_rpc(struct obd_export *exp,
         ptlrpc_req_set_repsize(req, 2, size);
         req->rq_request_portal = FLD_REQUEST_PORTAL;
 
+        if (fld_op != FLD_LOOKUP)
+                mdc_get_rpc_lock(exp->exp_obd->u.cli.cl_rpc_lock, NULL);
         rc = ptlrpc_queue_wait(req);
+        if (fld_op != FLD_LOOKUP)
+                mdc_put_rpc_lock(exp->exp_obd->u.cli.cl_rpc_lock, NULL);
         if (rc)
                 GOTO(out_req, rc);
 
index 3694e1c..f4d9ef0 100644 (file)
@@ -30,6 +30,39 @@ struct obd_export;
 struct ptlrpc_request;
 struct obd_device;
 
+struct mdc_rpc_lock {
+        struct semaphore rpcl_sem;
+        struct lookup_intent *rpcl_it;
+};
+
+static inline void mdc_init_rpc_lock(struct mdc_rpc_lock *lck)
+{
+        sema_init(&lck->rpcl_sem, 1);
+        lck->rpcl_it = NULL;
+}
+
+static inline void mdc_get_rpc_lock(struct mdc_rpc_lock *lck,
+                                    struct lookup_intent *it)
+{
+        ENTRY;
+        if (!it || (it->it_op != IT_GETATTR && it->it_op != IT_LOOKUP)) {
+                down(&lck->rpcl_sem);
+                LASSERT(lck->rpcl_it == NULL);
+                lck->rpcl_it = it;
+        }
+}
+
+static inline void mdc_put_rpc_lock(struct mdc_rpc_lock *lck,
+                                    struct lookup_intent *it)
+{
+        if (!it || (it->it_op != IT_GETATTR && it->it_op != IT_LOOKUP)) {
+                LASSERT(it == lck->rpcl_it);
+                lck->rpcl_it = NULL;
+                up(&lck->rpcl_sem);
+        }
+        EXIT;
+}
+
 /* mdc/mdc_locks.c */
 int it_disposition(struct lookup_intent *it, int flag);
 void it_clear_disposition(struct lookup_intent *it, int flag);
index d444750..bfcc8e6 100644 (file)
@@ -71,39 +71,6 @@ struct mdc_open_data {
         struct ptlrpc_request    *mod_close_req;
 };
 
-struct mdc_rpc_lock {
-        struct semaphore rpcl_sem;
-        struct lookup_intent *rpcl_it;
-};
-
-static inline void mdc_init_rpc_lock(struct mdc_rpc_lock *lck)
-{
-        sema_init(&lck->rpcl_sem, 1);
-        lck->rpcl_it = NULL;
-}
-
-static inline void mdc_get_rpc_lock(struct mdc_rpc_lock *lck,
-                                    struct lookup_intent *it)
-{
-        ENTRY;
-        if (!it || (it->it_op != IT_GETATTR && it->it_op != IT_LOOKUP)) {
-                down(&lck->rpcl_sem);
-                LASSERT(lck->rpcl_it == NULL);
-                lck->rpcl_it = it;
-        }
-}
-
-static inline void mdc_put_rpc_lock(struct mdc_rpc_lock *lck,
-                                    struct lookup_intent *it)
-{
-        if (!it || (it->it_op != IT_GETATTR && it->it_op != IT_LOOKUP)) {
-                LASSERT(it == lck->rpcl_it);
-                lck->rpcl_it = NULL;
-                up(&lck->rpcl_sem);
-        }
-        EXIT;
-}
-
 static inline int client_is_remote(struct obd_export *exp)
 {
         return class_exp2cliimp(exp)->imp_connect_data.ocd_connect_flags &