#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,
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);
#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,
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);
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);
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 &