From 1b06508451b359c5a7ee049e82c3a17537e7bb93 Mon Sep 17 00:00:00 2001 From: kalpak Date: Thu, 31 Jul 2008 09:09:49 +0000 Subject: [PATCH] b=16227 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. --- lustre/include/obd.h | 2 +- lustre/include/obd_class.h | 5 +++-- lustre/liblustre/rw.c | 5 ++--- lustre/liblustre/super.c | 2 +- lustre/llite/file.c | 5 ++--- lustre/llite/llite_lib.c | 6 +++--- lustre/lmv/lmv_obd.c | 6 +++--- lustre/lov/lov_obd.c | 12 ++++++------ lustre/lov/lov_pack.c | 2 +- lustre/mdc/mdc_request.c | 2 +- lustre/mds/mds_lov.c | 6 +++--- lustre/obdfilter/filter.c | 3 ++- lustre/osc/osc_request.c | 2 +- lustre/ost/ost_handler.c | 4 ++-- 14 files changed, 31 insertions(+), 31 deletions(-) diff --git a/lustre/include/obd.h b/lustre/include/obd.h index 3fff92b9..3778715 100644 --- a/lustre/include/obd.h +++ b/lustre/include/obd.h @@ -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, - __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); diff --git a/lustre/include/obd_class.h b/lustre/include/obd_class.h index 5913c1e..8c15615 100644 --- a/lustre/include/obd_class.h +++ b/lustre/include/obd_class.h @@ -399,7 +399,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; @@ -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); - 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); } diff --git a/lustre/liblustre/rw.c b/lustre/liblustre/rw.c index 94783c4..8f0e23a 100644 --- a/lustre/liblustre/rw.c +++ b/lustre/liblustre/rw.c @@ -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(); diff --git a/lustre/liblustre/super.c b/lustre/liblustre/super.c index 53dda39..70e5baa 100644 --- a/lustre/liblustre/super.c +++ b/lustre/liblustre/super.c @@ -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, - &valsize, &desc); + &valsize, &desc, NULL); if (rc) RETURN(rc); diff --git a/lustre/llite/file.c b/lustre/llite/file.c index f4426b6..e85ceb9 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -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 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; @@ -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 */ - 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); diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 870c15a..4528731 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -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, - &valsize, &desc); + &valsize, &desc, NULL); 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), - 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); @@ -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), - KEY_MAX_EASIZE, &size, lmmsize); + KEY_MAX_EASIZE, &size, lmmsize, NULL); if (rc) CERROR("Get max mdsize error rc %d \n", rc); diff --git a/lustre/lmv/lmv_obd.c b/lustre/lmv/lmv_obd.c index bbbd93c..c36d26b 100644 --- a/lustre/lmv/lmv_obd.c +++ b/lustre/lmv/lmv_obd.c @@ -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, - 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; @@ -2595,7 +2595,7 @@ static int lmv_get_info(struct obd_export *exp, __u32 keylen, } if (!obd_get_info(tgts->ltd_exp, keylen, key, - vallen, val)) + vallen, val, NULL)) 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, - vallen, val); + vallen, val, NULL); if (!rc && KEY_IS(KEY_CONN_DATA)) { exp->exp_connect_flags = ((struct obd_connect_data *)val)->ocd_connect_flags; diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index a95f442..b76a3f6 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -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, - 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; @@ -2524,7 +2525,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; @@ -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. */ - 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 == @@ -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"); - 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; @@ -2565,7 +2565,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; diff --git a/lustre/lov/lov_pack.c b/lustre/lov/lov_pack.c index 3fee96f..e2d3b3e 100644 --- a/lustre/lov/lov_pack.c +++ b/lustre/lov/lov_pack.c @@ -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, - &len, &last_id); + &len, &last_id, NULL); if (rc) RETURN(rc); if (lump->lmm_objects[i].l_object_id > last_id) { diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index ed78e85..a407864 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -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, - __u32 *vallen, void *val) + __u32 *vallen, void *val, struct lov_stripe_md *lsm) { int rc = -EINVAL; diff --git a/lustre/mds/mds_lov.c b/lustre/mds/mds_lov.c index c0613c6..9c930ac 100644 --- a/lustre/mds/mds_lov.c +++ b/lustre/mds/mds_lov.c @@ -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), - KEY_LAST_ID, &size, &lastid); + KEY_LAST_ID, &size, &lastid, NULL); 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, - &valsize, ost_uuid); + &valsize, ost_uuid, NULL); 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, - &valsize, ld); + &valsize, ld, NULL); if (rc) GOTO(out, rc); diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index eb6059d..80e5c47 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -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, - void *key, __u32 *vallen, void *val) + void *key, __u32 *vallen, void *val, + struct lov_stripe_md *lsm) { struct obd_device *obd; ENTRY; diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 7cd3825..e692775 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -3590,7 +3590,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) diff --git a/lustre/ost/ost_handler.c b/lustre/ost/ost_handler.c index 98428da..3596108 100644 --- a/lustre/ost/ost_handler.c +++ b/lustre/ost/ost_handler.c @@ -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); - rc = obd_get_info(exp, keylen, key, &replylen, NULL); + rc = obd_get_info(exp, keylen, key, &replylen, NULL, NULL); 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 */ - 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); -- 1.8.3.1