Whamcloud - gitweb
b=5765
authoralex <alex>
Mon, 14 Mar 2005 22:20:17 +0000 (22:20 +0000)
committeralex <alex>
Mon, 14 Mar 2005 22:20:17 +0000 (22:20 +0000)
r=adilger

  choose proper obd to match lock that protects directory content

lustre/cobd/cache_obd.c
lustre/include/linux/obd.h
lustre/include/linux/obd_class.h
lustre/llite/dir.c
lustre/llite/file.c
lustre/lmv/lmv_obd.c
lustre/mdc/mdc_request.c

index 884d82b..dd446bd 100644 (file)
@@ -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,
index 5cb53f7..29c77c7 100644 (file)
@@ -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,
index bd7ad68..faba9a6 100644 (file)
@@ -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,
index eae5276..b13bd1a 100644 (file)
@@ -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) {
index b1c172c..1f4a49a 100644 (file)
@@ -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,
index 31f6b04..7aac1f0 100644 (file)
@@ -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;
index 95d2440..bd7af6a 100644 (file)
@@ -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);