From ed332636815c778a8c2922755ef37b94e60333f2 Mon Sep 17 00:00:00 2001 From: kalpak Date: Thu, 31 Jul 2008 09:03: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/llite/file.c | 5 ++--- lustre/llite/llite_lib.c | 2 +- lustre/lov/lov_obd.c | 12 ++++++------ lustre/lov/lov_pack.c | 2 +- lustre/mdc/mdc_request.c | 4 ++-- lustre/mds/mds_lov.c | 6 +++--- lustre/obdfilter/filter.c | 3 ++- lustre/osc/osc_request.c | 2 +- lustre/ost/ost_handler.c | 4 ++-- 12 files changed, 26 insertions(+), 26 deletions(-) diff --git a/lustre/include/obd.h b/lustre/include/obd.h index e3556cf..e18dc6f 100644 --- a/lustre/include/obd.h +++ b/lustre/include/obd.h @@ -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); diff --git a/lustre/include/obd_class.h b/lustre/include/obd_class.h index dee007f..e0812fd 100644 --- a/lustre/include/obd_class.h +++ b/lustre/include/obd_class.h @@ -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); } diff --git a/lustre/liblustre/rw.c b/lustre/liblustre/rw.c index 690c421..445a7fe 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/llite/file.c b/lustre/llite/file.c index 8f90640..353fee9 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -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); diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 2fcc08c..f18eb7c 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -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); diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index 093c382..5c26d48 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -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; diff --git a/lustre/lov/lov_pack.c b/lustre/lov/lov_pack.c index dba7c17..2731095 100644 --- a/lustre/lov/lov_pack.c +++ b/lustre/lov/lov_pack.c @@ -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) { diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index 8cf26e4..8815684 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -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); diff --git a/lustre/mds/mds_lov.c b/lustre/mds/mds_lov.c index 2fc1724..ad4db6e 100644 --- a/lustre/mds/mds_lov.c +++ b/lustre/mds/mds_lov.c @@ -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); diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 578104f..8c2c734 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -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; diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 2b99fe5..35e3169 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -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) diff --git a/lustre/ost/ost_handler.c b/lustre/ost/ost_handler.c index 21356e3..bd6708c 100644 --- a/lustre/ost/ost_handler.c +++ b/lustre/ost/ost_handler.c @@ -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); -- 1.8.3.1