From 4232d07712a5bbf2a0ae21dad29e3170d45ea560 Mon Sep 17 00:00:00 2001 From: alex Date: Mon, 14 Mar 2005 22:20:17 +0000 Subject: [PATCH] b=5765 r=adilger choose proper obd to match lock that protects directory content --- lustre/cobd/cache_obd.c | 4 ++-- lustre/include/linux/obd.h | 3 +-- lustre/include/linux/obd_class.h | 4 ++-- lustre/llite/dir.c | 2 +- lustre/llite/file.c | 2 +- lustre/lmv/lmv_obd.c | 4 ++-- lustre/mdc/mdc_request.c | 2 +- 7 files changed, 10 insertions(+), 11 deletions(-) diff --git a/lustre/cobd/cache_obd.c b/lustre/cobd/cache_obd.c index 884d82b..dd446bd 100644 --- a/lustre/cobd/cache_obd.c +++ b/lustre/cobd/cache_obd.c @@ -1197,7 +1197,7 @@ static int cobd_md_intent_lock(struct obd_export *exp, struct lustre_id *pid, } static struct obd_device *cobd_md_get_real_obd(struct obd_export *exp, - char *name, int len) + struct lustre_id *id) { struct obd_device *obd = class_exp2obd(exp); struct obd_export *cobd_exp; @@ -1208,7 +1208,7 @@ static struct obd_device *cobd_md_get_real_obd(struct obd_export *exp, return NULL; } cobd_exp = cobd_get_exp(obd); - return md_get_real_obd(cobd_exp, name, len); + return md_get_real_obd(cobd_exp, id); } static int cobd_md_change_cbdata_name(struct obd_export *exp, diff --git a/lustre/include/linux/obd.h b/lustre/include/linux/obd.h index 5cb53f7..29c77c7 100644 --- a/lustre/include/linux/obd.h +++ b/lustre/include/linux/obd.h @@ -877,8 +877,7 @@ struct md_ops { struct ptlrpc_request **); int (*m_valid_attrs)(struct obd_export *, struct lustre_id *); - struct obd_device *(*m_get_real_obd)(struct obd_export *, - char *name, int len); + struct obd_device *(*m_get_real_obd)(struct obd_export *, struct lustre_id *); int (*m_req2lustre_md)(struct obd_export *exp, struct ptlrpc_request *req, unsigned int offset, diff --git a/lustre/include/linux/obd_class.h b/lustre/include/linux/obd_class.h index bd7ad68..faba9a6 100644 --- a/lustre/include/linux/obd_class.h +++ b/lustre/include/linux/obd_class.h @@ -1447,13 +1447,13 @@ static inline int md_unlink(struct obd_export *exp, struct mdc_op_data *data, } static inline struct obd_device *md_get_real_obd(struct obd_export *exp, - char *name, int len) + struct lustre_id *fid) { ENTRY; if (MDP(exp->exp_obd, get_real_obd) == NULL) return exp->exp_obd; MD_COUNTER_INCREMENT(exp->exp_obd, get_real_obd); - return MDP(exp->exp_obd, get_real_obd)(exp, name, len); + return MDP(exp->exp_obd, get_real_obd)(exp, fid); } static inline int md_valid_attrs(struct obd_export *exp, diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c index eae5276..b13bd1a 100644 --- a/lustre/llite/dir.c +++ b/lustre/llite/dir.c @@ -218,7 +218,7 @@ static struct page *ll_get_dir_page(struct inode *dir, unsigned long n) ldlm_policy_data_t policy = { .l_inodebits = { MDS_INODELOCK_UPDATE } }; int rc; - obddev = md_get_real_obd(ll_i2sbi(dir)->ll_md_exp, NULL, 0); + obddev = md_get_real_obd(ll_i2sbi(dir)->ll_md_exp, &li->lli_id); rc = ldlm_lock_match(obddev->obd_namespace, LDLM_FL_BLOCK_GRANTED, &res_id, LDLM_IBITS, &policy, LCK_PR, &lockh); if (!rc) { diff --git a/lustre/llite/file.c b/lustre/llite/file.c index b1c172c..1f4a49a 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -1429,7 +1429,7 @@ int ll_file_flock(struct file *file, int cmd, struct file_lock *file_lock) "start="LPU64", end="LPU64"\n", inode->i_ino, flock.l_flock.pid, flags, mode, flock.l_flock.start, flock.l_flock.end); - obddev = md_get_real_obd(sbi->ll_md_exp, NULL, 0); + obddev = md_get_real_obd(sbi->ll_md_exp, &li->lli_id); rc = ldlm_cli_enqueue(obddev->obd_self_export, NULL, obddev->obd_namespace, res_id, LDLM_FLOCK, &flock, mode, &flags, diff --git a/lustre/lmv/lmv_obd.c b/lustre/lmv/lmv_obd.c index 31f6b04..7aac1f0 100644 --- a/lustre/lmv/lmv_obd.c +++ b/lustre/lmv/lmv_obd.c @@ -1531,7 +1531,7 @@ int lmv_unlink(struct obd_export *exp, struct mdc_op_data *data, } struct obd_device *lmv_get_real_obd(struct obd_export *exp, - char *name, int len) + struct lustre_id *id) { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; @@ -1541,7 +1541,7 @@ struct obd_device *lmv_get_real_obd(struct obd_export *exp, rc = lmv_check_connect(obd); if (rc) RETURN(ERR_PTR(rc)); - obd = lmv->tgts[0].ltd_exp->exp_obd; + obd = lmv->tgts[id_group(id)].ltd_exp->exp_obd; EXIT; return obd; diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index 95d2440..bd7af6a 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -1172,7 +1172,7 @@ static int mdc_llog_finish(struct obd_device *obd, RETURN(rc); } static struct obd_device *mdc_get_real_obd(struct obd_export *exp, - char *name, int len) + struct lustre_id *id) { ENTRY; RETURN(exp->exp_obd); -- 1.8.3.1