From 0552c7db4b3000b49054ade1a2934a80ff6f933d Mon Sep 17 00:00:00 2001 From: zhanghc Date: Wed, 24 Dec 2008 11:55:45 +0000 Subject: [PATCH] b=17757 remove redundant code in previous patch i=tappro --- lustre/mds/mds_open.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/lustre/mds/mds_open.c b/lustre/mds/mds_open.c index 661def8..5e4fe19 100644 --- a/lustre/mds/mds_open.c +++ b/lustre/mds/mds_open.c @@ -519,9 +519,7 @@ static void reconstruct_open(struct mds_update_record *rec, int offset, struct obd_export *exp = req->rq_export; struct obd_device *obd = exp->exp_obd; struct dentry *parent, *dchild; - struct ldlm_request *dlmreq; struct ldlm_reply *rep; - struct ldlm_lock *lock; struct mds_body *body; int rc; struct list_head *t; @@ -685,16 +683,9 @@ static void reconstruct_open(struct mds_update_record *rec, int offset, if (!intent_disposition(rep, DISP_OPEN_LOCK)) GOTO(out_dput, 0); - dlmreq = lustre_msg_buf(req->rq_reqmsg, DLM_LOCKREQ_OFF, - sizeof(*dlmreq)); - /* find granted lock in obd_export->exp_lock_hash by remote handle */ - lock = lustre_hash_lookup(exp->exp_lock_hash, &dlmreq->lock_handle[0]); - - if (lock != NULL) { - /* grant the lock again! */ - ldlm_lock2handle(lock, child_lockh); - lh_put(exp->exp_lock_hash, &lock->l_exp_hash); - } else { + /* child_lockh has been set in fixup_handle_for_resent_req called + * in mds_intent_policy for resent request */ + if (child_lockh == NULL || !lustre_handle_is_used(child_lockh)) { /* the lock is already canceled! clear DISP_OPEN_LOCK */ intent_disposition(rep, ~DISP_OPEN_LOCK); } -- 1.8.3.1