Whamcloud - gitweb
b=16227
authorkalpak <kalpak>
Thu, 31 Jul 2008 09:09:49 +0000 (09:09 +0000)
committerkalpak <kalpak>
Thu, 31 Jul 2008 09:09:49 +0000 (09:09 +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.

14 files changed:
lustre/include/obd.h
lustre/include/obd_class.h
lustre/liblustre/rw.c
lustre/liblustre/super.c
lustre/llite/file.c
lustre/llite/llite_lib.c
lustre/lmv/lmv_obd.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 3fff92b..3778715 100644 (file)
@@ -1140,7 +1140,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,
         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);
         int (*o_set_info_async)(struct obd_export *, __u32 keylen, void *key,
                                 __u32 vallen, void *val,
                                 struct ptlrpc_request_set *set);
index 5913c1e..8c15615 100644 (file)
@@ -399,7 +399,8 @@ static inline int class_devno_max(void)
 }
 
 static inline int obd_get_info(struct obd_export *exp, __u32 keylen,
 }
 
 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;
 {
         int rc;
         ENTRY;
@@ -407,7 +408,7 @@ static inline int obd_get_info(struct obd_export *exp, __u32 keylen,
         EXP_CHECK_DT_OP(exp, get_info);
         EXP_COUNTER_INCREMENT(exp, get_info);
 
         EXP_CHECK_DT_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);
 }
 
         RETURN(rc);
 }
 
index 94783c4..8f0e23a 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 {
                 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;
         __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 */
                 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();
         if (rc != 0) {
                 CERROR("obd_get_info: rc = %d\n", rc);
                 LBUG();
index 53dda39..70e5baa 100644 (file)
@@ -1976,7 +1976,7 @@ llu_init_ea_size(struct obd_export *md_exp, struct obd_export *dt_exp)
         ENTRY;
 
         rc = obd_get_info(dt_exp, sizeof(KEY_LOVDESC), KEY_LOVDESC,
         ENTRY;
 
         rc = obd_get_info(dt_exp, sizeof(KEY_LOVDESC), KEY_LOVDESC,
-                          &valsize, &desc);
+                          &valsize, &desc, NULL);
         if (rc)
                 RETURN(rc);
 
         if (rc)
                 RETURN(rc);
 
index f4426b6..e85ceb9 100644 (file)
@@ -750,8 +750,7 @@ static int ll_lock_to_stripe_offset(struct inode *inode, struct ldlm_lock *lock)
         struct {
                 char name[16];
                 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);
         struct lov_oinfo *loinfo;
         int rc;
         __u32 stripe, vallen = sizeof(stripe);
         struct lov_oinfo *loinfo;
         int rc;
@@ -761,7 +760,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 */
                 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);
         if (rc != 0) {
                 CERROR("obd_get_info: rc = %d\n", rc);
                 RETURN(rc);
index 870c15a..4528731 100644 (file)
@@ -252,7 +252,7 @@ static int ll_init_ea_size(struct obd_export *md_exp, struct obd_export *dt_exp)
         ENTRY;
 
         rc = obd_get_info(dt_exp, sizeof(KEY_LOVDESC), KEY_LOVDESC,
         ENTRY;
 
         rc = obd_get_info(dt_exp, sizeof(KEY_LOVDESC), KEY_LOVDESC,
-                          &valsize, &desc);
+                          &valsize, &desc, NULL);
         if (rc)
                 RETURN(rc);
 
         if (rc)
                 RETURN(rc);
 
@@ -376,7 +376,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt)
 
         size = sizeof(*data);
         err = obd_get_info(sbi->ll_md_exp, sizeof(KEY_CONN_DATA),
 
         size = sizeof(*data);
         err = obd_get_info(sbi->ll_md_exp, sizeof(KEY_CONN_DATA),
-                           KEY_CONN_DATA,  &size, data);
+                           KEY_CONN_DATA,  &size, data, NULL);
         if (err) {
                 CERROR("Get connect data failed: %d \n", err);
                 GOTO(out_md, err);
         if (err) {
                 CERROR("Get connect data failed: %d \n", err);
                 GOTO(out_md, err);
@@ -678,7 +678,7 @@ int ll_get_max_mdsize(struct ll_sb_info *sbi, int *lmmsize)
         *lmmsize = obd_size_diskmd(sbi->ll_dt_exp, NULL);
         size = sizeof(int);
         rc = obd_get_info(sbi->ll_md_exp, sizeof(KEY_MAX_EASIZE),
         *lmmsize = obd_size_diskmd(sbi->ll_dt_exp, NULL);
         size = sizeof(int);
         rc = obd_get_info(sbi->ll_md_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);
 
         if (rc)
                 CERROR("Get max mdsize error rc %d \n", rc);
 
index bbbd93c..c36d26b 100644 (file)
@@ -2561,7 +2561,7 @@ static int lmv_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
 }
 
 static int lmv_get_info(struct obd_export *exp, __u32 keylen,
 }
 
 static int lmv_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;
         struct lmv_obd *lmv;
 {
         struct obd_device *obd;
         struct lmv_obd *lmv;
@@ -2595,7 +2595,7 @@ static int lmv_get_info(struct obd_export *exp, __u32 keylen,
                         }
 
                         if (!obd_get_info(tgts->ltd_exp, keylen, key,
                         }
 
                         if (!obd_get_info(tgts->ltd_exp, keylen, key,
-                                          vallen, val))
+                                          vallen, val, NULL))
                                 RETURN(0);
                 }
                 RETURN(-EINVAL);
                                 RETURN(0);
                 }
                 RETURN(-EINVAL);
@@ -2607,7 +2607,7 @@ static int lmv_get_info(struct obd_export *exp, __u32 keylen,
                 /* forwarding this request to first MDS, it should know LOV
                  * desc. */
                 rc = obd_get_info(lmv->tgts[0].ltd_exp, keylen, key,
                 /* forwarding this request to first MDS, it should know LOV
                  * desc. */
                 rc = obd_get_info(lmv->tgts[0].ltd_exp, keylen, key,
-                                  vallen, val);
+                                  vallen, val, NULL);
                 if (!rc && KEY_IS(KEY_CONN_DATA)) {
                         exp->exp_connect_flags =
                         ((struct obd_connect_data *)val)->ocd_connect_flags;
                 if (!rc && KEY_IS(KEY_CONN_DATA)) {
                         exp->exp_connect_flags =
                         ((struct obd_connect_data *)val)->ocd_connect_flags;
index a95f442..b76a3f6 100644 (file)
@@ -2508,7 +2508,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,
 }
 
 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;
 {
         struct obd_device *obddev = class_exp2obd(exp);
         struct lov_obd *lov = &obddev->u.lov;
@@ -2524,7 +2525,6 @@ static int lov_get_info(struct obd_export *exp, __u32 keylen,
                 struct {
                         char name[16];
                         struct ldlm_lock *lock;
                 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;
                 } *data = key;
                 struct ldlm_res_id *res_id = &data->lock->l_resource->lr_name;
                 struct lov_oinfo *loi;
@@ -2540,8 +2540,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. */
                 /* 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 ==
                         if (!lov->lov_tgts[loi->loi_ost_idx])
                                 continue;
                         if (lov->lov_tgts[loi->loi_ost_idx]->ltd_exp ==
@@ -2552,7 +2552,7 @@ static int lov_get_info(struct obd_export *exp, __u32 keylen,
                         }
                 }
                 LDLM_ERROR(data->lock, "lock on inode without such object");
                         }
                 }
                 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;
                 GOTO(out, rc = -ENXIO);
         } else if (KEY_IS(KEY_LAST_ID)) {
                 struct obd_id_info *info = val;
@@ -2565,7 +2565,7 @@ static int lov_get_info(struct obd_export *exp, __u32 keylen,
                 if (!tgt || !tgt->ltd_active)
                         GOTO(out, rc = -ESRCH);
 
                 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;
                 GOTO(out, rc = 0);
         } else if (KEY_IS(KEY_LOVDESC)) {
                 struct lov_desc *desc_ret = val;
index 3fee96f..e2d3b3e 100644 (file)
@@ -411,7 +411,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,
                 __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) {
                 if (rc)
                         RETURN(rc);
                 if (lump->lmm_objects[i].l_object_id > last_id) {
index ed78e85..a407864 100644 (file)
@@ -1192,7 +1192,7 @@ int mdc_set_info_async(struct obd_export *exp,
 }
 
 int mdc_get_info(struct obd_export *exp, __u32 keylen, void *key,
 }
 
 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;
 
 {
         int rc = -EINVAL;
 
index c0613c6..9c930ac 100644 (file)
@@ -277,7 +277,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),
                 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);
 
                 if (rc)
                         GOTO(out, rc);
 
@@ -349,7 +349,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,
         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);
         LASSERT(rc >= 0);
 
         RETURN(rc);
@@ -369,7 +369,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,
                 RETURN(-ENOMEM);
 
         rc = obd_get_info(lov, sizeof(KEY_LOVDESC), KEY_LOVDESC,
-                          &valsize, ld);
+                          &valsize, ld, NULL);
         if (rc)
                 GOTO(out, rc);
 
         if (rc)
                 GOTO(out, rc);
 
index eb6059d..80e5c47 100644 (file)
@@ -4067,7 +4067,8 @@ static int filter_sync(struct obd_export *exp, struct obdo *oa,
 }
 
 static int filter_get_info(struct obd_export *exp, __u32 keylen,
 }
 
 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;
 {
         struct obd_device *obd;
         ENTRY;
index 7cd3825..e692775 100644 (file)
@@ -3590,7 +3590,7 @@ out:
 }
 
 static int osc_get_info(struct obd_export *exp, obd_count keylen,
 }
 
 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)
 {
         ENTRY;
         if (!vallen || !val)
index 98428da..3596108 100644 (file)
@@ -1341,7 +1341,7 @@ static int ost_get_info(struct obd_export *exp, struct ptlrpc_request *req)
         }
         keylen = req_capsule_get_size(pill, &RMF_SETINFO_KEY, RCL_CLIENT);
 
         }
         keylen = req_capsule_get_size(pill, &RMF_SETINFO_KEY, RCL_CLIENT);
 
-        rc = obd_get_info(exp, keylen, key, &replylen, NULL);
+        rc = obd_get_info(exp, keylen, key, &replylen, NULL, NULL);
         if (rc)
                 RETURN(rc);
 
         if (rc)
                 RETURN(rc);
 
@@ -1357,7 +1357,7 @@ static int ost_get_info(struct obd_export *exp, struct ptlrpc_request *req)
                 RETURN(-ENOMEM);
 
         /* call again to fill in the reply buffer */
                 RETURN(-ENOMEM);
 
         /* call again to fill in the reply buffer */
-        rc = obd_get_info(exp, keylen, key, &replylen, reply);
+        rc = obd_get_info(exp, keylen, key, &replylen, reply, NULL);
 
         lustre_msg_set_status(req->rq_repmsg, 0);
         RETURN(rc);
 
         lustre_msg_set_status(req->rq_repmsg, 0);
         RETURN(rc);