Whamcloud - gitweb
b=16227
authorkalpak <kalpak>
Thu, 31 Jul 2008 09:03:49 +0000 (09:03 +0000)
committerkalpak <kalpak>
Thu, 31 Jul 2008 09:03:49 +0000 (09:03 +0000)
i=adilger
i=shadow

add lsm argument to obd_get_info. For some get_info calls the lsm was being sent as part of the key which was a hack. Now lsm can be sent as an argument.

12 files changed:
lustre/include/obd.h
lustre/include/obd_class.h
lustre/liblustre/rw.c
lustre/llite/file.c
lustre/llite/llite_lib.c
lustre/lov/lov_obd.c
lustre/lov/lov_pack.c
lustre/mdc/mdc_request.c
lustre/mds/mds_lov.c
lustre/obdfilter/filter.c
lustre/osc/osc_request.c
lustre/ost/ost_handler.c

index e3556cf..e18dc6f 100644 (file)
@@ -943,7 +943,7 @@ struct obd_ops {
         int (*o_iocontrol)(unsigned int cmd, struct obd_export *exp, int len,
                            void *karg, void *uarg);
         int (*o_get_info)(struct obd_export *, __u32 keylen, void *key,
-                          __u32 *vallen, void *val);
+                          __u32 *vallen, void *val, struct lov_stripe_md *lsm);
         int (*o_set_info_async)(struct obd_export *, __u32 keylen, void *key,
                                 __u32 vallen, void *val,
                                 struct ptlrpc_request_set *set);
index dee007f..e0812fd 100644 (file)
@@ -330,7 +330,8 @@ static inline int class_devno_max(void)
 }
 
 static inline int obd_get_info(struct obd_export *exp, __u32 keylen,
-                               void *key, __u32 *vallen, void *val)
+                               void *key, __u32 *vallen, void *val,
+                               struct lov_stripe_md *lsm)
 {
         int rc;
         ENTRY;
@@ -338,7 +339,7 @@ static inline int obd_get_info(struct obd_export *exp, __u32 keylen,
         EXP_CHECK_OP(exp, get_info);
         EXP_COUNTER_INCREMENT(exp, get_info);
 
-        rc = OBP(exp->exp_obd, get_info)(exp, keylen, key, vallen, val);
+        rc = OBP(exp->exp_obd, get_info)(exp, keylen, key, vallen, val, lsm);
         RETURN(rc);
 }
 
index 690c421..445a7fe 100644 (file)
@@ -110,8 +110,7 @@ static int llu_lock_to_stripe_offset(struct inode *inode, struct ldlm_lock *lock
         struct {
                 char name[16];
                 struct ldlm_lock *lock;
-                struct lov_stripe_md *lsm;
-        } key = { .name = KEY_LOCK_TO_STRIPE, .lock = lock, .lsm = lsm };
+        } key = { .name = KEY_LOCK_TO_STRIPE, .lock = lock };
         __u32 stripe, vallen = sizeof(stripe);
         int rc;
         ENTRY;
@@ -120,7 +119,7 @@ static int llu_lock_to_stripe_offset(struct inode *inode, struct ldlm_lock *lock
                 RETURN(0);
 
         /* get our offset in the lov */
-        rc = obd_get_info(exp, sizeof(key), &key, &vallen, &stripe);
+        rc = obd_get_info(exp, sizeof(key), &key, &vallen, &stripe, lsm);
         if (rc != 0) {
                 CERROR("obd_get_info: rc = %d\n", rc);
                 LBUG();
index 8f90640..353fee9 100644 (file)
@@ -648,8 +648,7 @@ static int ll_lock_to_stripe_offset(struct inode *inode, struct ldlm_lock *lock)
         struct {
                 char name[16];
                 struct ldlm_lock *lock;
-                struct lov_stripe_md *lsm;
-        } key = { .name = KEY_LOCK_TO_STRIPE, .lock = lock, .lsm = lsm };
+        } key = { .name = KEY_LOCK_TO_STRIPE, .lock = lock };
         __u32 stripe, vallen = sizeof(stripe);
         int rc;
         ENTRY;
@@ -658,7 +657,7 @@ static int ll_lock_to_stripe_offset(struct inode *inode, struct ldlm_lock *lock)
                 GOTO(check, stripe = 0);
 
         /* get our offset in the lov */
-        rc = obd_get_info(exp, sizeof(key), &key, &vallen, &stripe);
+        rc = obd_get_info(exp, sizeof(key), &key, &vallen, &stripe, lsm);
         if (rc != 0) {
                 CERROR("obd_get_info: rc = %d\n", rc);
                 RETURN(rc);
index 2fcc08c..f18eb7c 100644 (file)
@@ -479,7 +479,7 @@ int ll_get_max_mdsize(struct ll_sb_info *sbi, int *lmmsize)
         *lmmsize = obd_size_diskmd(sbi->ll_osc_exp, NULL);
         size = sizeof(int);
         rc = obd_get_info(sbi->ll_mdc_exp, sizeof(KEY_MAX_EASIZE),
-                          KEY_MAX_EASIZE, &size, lmmsize);
+                          KEY_MAX_EASIZE, &size, lmmsize, NULL);
         if (rc)
                 CERROR("Get max mdsize error rc %d \n", rc);
 
index 093c382..5c26d48 100644 (file)
@@ -2470,7 +2470,8 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
 }
 
 static int lov_get_info(struct obd_export *exp, __u32 keylen,
-                        void *key, __u32 *vallen, void *val)
+                        void *key, __u32 *vallen, void *val,
+                        struct lov_stripe_md *lsm)
 {
         struct obd_device *obddev = class_exp2obd(exp);
         struct lov_obd *lov = &obddev->u.lov;
@@ -2486,7 +2487,6 @@ static int lov_get_info(struct obd_export *exp, __u32 keylen,
                 struct {
                         char name[16];
                         struct ldlm_lock *lock;
-                        struct lov_stripe_md *lsm;
                 } *data = key;
                 struct ldlm_res_id *res_id = &data->lock->l_resource->lr_name;
                 struct lov_oinfo *loi;
@@ -2502,8 +2502,8 @@ static int lov_get_info(struct obd_export *exp, __u32 keylen,
                 /* XXX - it's assumed all the locks for deleted OSTs have
                  * been cancelled. Also, the export for deleted OSTs will
                  * be NULL and won't match the lock's export. */
-                for (i = 0; i < data->lsm->lsm_stripe_count; i++) {
-                        loi = data->lsm->lsm_oinfo[i];
+                for (i = 0; i < lsm->lsm_stripe_count; i++) {
+                        loi = lsm->lsm_oinfo[i];
                         if (!lov->lov_tgts[loi->loi_ost_idx])
                                 continue;
                         if (lov->lov_tgts[loi->loi_ost_idx]->ltd_exp ==
@@ -2515,7 +2515,7 @@ static int lov_get_info(struct obd_export *exp, __u32 keylen,
                         }
                 }
                 LDLM_ERROR(data->lock, "lock on inode without such object");
-                dump_lsm(D_ERROR, data->lsm);
+                dump_lsm(D_ERROR, lsm);
                 GOTO(out, rc = -ENXIO);
         } else if (KEY_IS(KEY_LAST_ID)) {
                 struct obd_id_info *info = val;
@@ -2528,7 +2528,7 @@ static int lov_get_info(struct obd_export *exp, __u32 keylen,
                 if (!tgt || !tgt->ltd_active)
                         GOTO(out, rc = -ESRCH);
 
-                rc = obd_get_info(tgt->ltd_exp, keylen, key, &size, info->data);
+                rc = obd_get_info(tgt->ltd_exp, keylen, key, &size, info->data, NULL);
                 GOTO(out, rc = 0);
         } else if (KEY_IS(KEY_LOVDESC)) {
                 struct lov_desc *desc_ret = val;
index dba7c17..2731095 100644 (file)
@@ -396,7 +396,7 @@ int lov_setea(struct obd_export *exp, struct lov_stripe_md **lsmp,
                 __u32 len = sizeof(last_id);
                 oexp = lov->lov_tgts[lump->lmm_objects[i].l_ost_idx]->ltd_exp;
                 rc = obd_get_info(oexp, sizeof(KEY_LAST_ID), KEY_LAST_ID,
-                                  &len, &last_id);
+                                  &len, &last_id, NULL);
                 if (rc)
                         RETURN(rc);
                 if (lump->lmm_objects[i].l_object_id > last_id) {
index 8cf26e4..8815684 100644 (file)
@@ -975,7 +975,7 @@ int mdc_set_info_async(struct obd_export *exp, obd_count keylen,
 }
 
 int mdc_get_info(struct obd_export *exp, __u32 keylen, void *key,
-                 __u32 *vallen, void *val)
+                 __u32 *vallen, void *val, struct lov_stripe_md *lsm)
 {
         int rc = -EINVAL;
 
@@ -1267,7 +1267,7 @@ int mdc_init_ea_size(struct obd_export *mdc_exp, struct obd_export *lov_exp)
         ENTRY;
 
         rc = obd_get_info(lov_exp, sizeof(KEY_LOVDESC), KEY_LOVDESC,
-                          &valsize, &desc);
+                          &valsize, &desc, NULL);
         if (rc)
                 RETURN(rc);
 
index 2fc1724..ad4db6e 100644 (file)
@@ -311,7 +311,7 @@ static int mds_lov_get_objid(struct obd_device * obd,
                 lastid.idx = idx;
                 lastid.data = &data[off];
                 rc = obd_get_info(mds->mds_osc_exp, sizeof(KEY_LAST_ID),
-                                  KEY_LAST_ID, &size, &lastid);
+                                  KEY_LAST_ID, &size, &lastid, NULL);
                 if (rc)
                         GOTO(out, rc);
 
@@ -383,7 +383,7 @@ static __u32 mds_lov_get_idx(struct obd_export *lov,
         int valsize = sizeof(ost_uuid);
 
         rc = obd_get_info(lov, sizeof(KEY_LOV_IDX), KEY_LOV_IDX,
-                          &valsize, ost_uuid);
+                          &valsize, ost_uuid, NULL);
         LASSERT(rc >= 0);
 
         RETURN(rc);
@@ -403,7 +403,7 @@ static int mds_lov_update_desc(struct obd_device *obd, struct obd_export *lov)
                 RETURN(-ENOMEM);
 
         rc = obd_get_info(lov, sizeof(KEY_LOVDESC), KEY_LOVDESC,
-                          &valsize, ld);
+                          &valsize, ld, NULL);
         if (rc)
                 GOTO(out, rc);
 
index 578104f..8c2c734 100644 (file)
@@ -3483,7 +3483,8 @@ static int filter_sync(struct obd_export *exp, struct obdo *oa,
 }
 
 static int filter_get_info(struct obd_export *exp, __u32 keylen,
-                           void *key, __u32 *vallen, void *val)
+                           void *key, __u32 *vallen, void *val,
+                           struct lov_stripe_md *lsm)
 {
         struct obd_device *obd;
         ENTRY;
index 2b99fe5..35e3169 100644 (file)
@@ -3455,7 +3455,7 @@ out:
 }
 
 static int osc_get_info(struct obd_export *exp, obd_count keylen,
-                        void *key, __u32 *vallen, void *val)
+                        void *key, __u32 *vallen, void *val, struct lov_stripe_md *lsm)
 {
         ENTRY;
         if (!vallen || !val)
index 21356e3..bd6708c 100644 (file)
@@ -1335,7 +1335,7 @@ static int ost_get_info(struct obd_export *exp, struct ptlrpc_request *req)
         keylen = lustre_msg_buflen(req->rq_reqmsg, REQ_REC_OFF);
 
         /* call once to get the size to allocate the reply buffer */
-        rc = obd_get_info(exp, keylen, key, &size[1], NULL);
+        rc = obd_get_info(exp, keylen, key, &size[1], NULL, NULL);
         if (rc)
                 RETURN(rc);
 
@@ -1345,7 +1345,7 @@ static int ost_get_info(struct obd_export *exp, struct ptlrpc_request *req)
 
         reply = lustre_msg_buf(req->rq_repmsg, REPLY_REC_OFF, sizeof(*reply));
         /* call again to fill in the reply buffer */
-        rc = obd_get_info(exp, keylen, key, size, reply);
+        rc = obd_get_info(exp, keylen, key, size, reply, NULL);
         lustre_msg_set_status(req->rq_repmsg, 0);
 
         RETURN(rc);