X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fcobd%2Fcache_obd.c;h=bb3bbcf0f2e24dd93b61cc139698fb63c3a2ab48;hb=b8c8ad79dcd4a30bfc839d87f7a983c400d3e327;hp=f4072ebcedf70d31c55ce2573bc2f9f81528c7e6;hpb=7bb892f4f3de837a940d867b97fe14013ad67dc6;p=fs%2Flustre-release.git diff --git a/lustre/cobd/cache_obd.c b/lustre/cobd/cache_obd.c index f4072eb..bb3bbcf 100644 --- a/lustre/cobd/cache_obd.c +++ b/lustre/cobd/cache_obd.c @@ -31,8 +31,10 @@ #include #include #include +#include -static int cobd_attach(struct obd_device *obd, obd_count len, void *buf) +static int cobd_attach(struct obd_device *obd, + obd_count len, void *buf) { struct lprocfs_static_vars lvars; @@ -45,160 +47,194 @@ static int cobd_detach(struct obd_device *obd) return lprocfs_obd_detach(obd); } -static int connect_to_obd(char *name, struct lustre_handle *conn) -{ - struct obd_uuid obd_uuid; - struct obd_device *obd; - int rc = 0; - ENTRY; - - obd = class_name2obd(name); - if (obd == NULL) { - CERROR("%s: unable to find a client for obd: %s\n", - obd->obd_name, name); - RETURN(-EINVAL); - } - rc = obd_connect(conn, obd, &obd_uuid, 0); - RETURN(rc); -} - static int cobd_setup(struct obd_device *obd, obd_count len, void *buf) { struct lustre_cfg *lcfg = (struct lustre_cfg *)buf; struct cache_obd *cobd = &obd->u.cobd; -// struct lustre_handle real_conn = {0,}, cache_conn = {0,}; - struct lustre_handle cache_conn = {0,}; - struct obd_device *real; - struct obd_device *cache; - int rc; + struct obd_device *master; + int rc = 0; ENTRY; if (lcfg->lcfg_inllen1 == 0 || lcfg->lcfg_inlbuf1 == NULL) { - CERROR("%s: setup requires real device name\n", + CERROR("%s: setup requires master device name\n", obd->obd_name); RETURN(-EINVAL); } - real = class_name2obd(lcfg->lcfg_inlbuf1); - if (real == NULL) { - CERROR("%s: unable to find a client for real: %s\n", - obd->obd_name, lcfg->lcfg_inlbuf1); - RETURN(-EINVAL); - } - if (lcfg->lcfg_inllen2 == 0 || lcfg->lcfg_inlbuf2 == NULL) { - CERROR("%s: setup requires cache device name\n", obd->obd_name); + CERROR("%s: setup requires cache device name\n", + obd->obd_name); RETURN(-EINVAL); } - cache = class_name2obd(lcfg->lcfg_inlbuf2); - if (cache == NULL) { - CERROR("%s: unable to find a client for cache: %s\n", - obd->obd_name, lcfg->lcfg_inlbuf2); + master = class_name2obd(lcfg->lcfg_inlbuf1); + if (!master) { + CERROR("%s: unable to find master: %s\n", + obd->obd_name, lcfg->lcfg_inlbuf1); RETURN(-EINVAL); } - OBD_ALLOC(cobd->cobd_real_name, strlen(lcfg->lcfg_inlbuf1) + 1); - if (!cobd->cobd_real_name) - GOTO(exit, rc = -ENOMEM); - memcpy(cobd->cobd_real_name, lcfg->lcfg_inlbuf1, - strlen(lcfg->lcfg_inlbuf1)); - - OBD_ALLOC(cobd->cobd_cache_name, strlen(lcfg->lcfg_inlbuf2) + 1); - if (!cobd->cobd_cache_name) - GOTO(exit, rc = -ENOMEM); - memcpy(cobd->cobd_cache_name, lcfg->lcfg_inlbuf2, - strlen(lcfg->lcfg_inlbuf2)); - -#if 0 - /* don't bother checking attached/setup; - * obd_connect() should, and it can change underneath us */ - rc = connect_to_obd(cobd->cobd_real_name, &real_conn); - if (rc != 0) - GOTO(exit, rc); - cobd->cobd_real_exp = class_conn2export(&real_conn); -#endif - rc = connect_to_obd(cobd->cobd_cache_name, &cache_conn); - if (rc != 0) { - obd_disconnect(cobd->cobd_cache_exp, 0); - GOTO(exit, rc); - } - cobd->cobd_cache_exp = class_conn2export(&cache_conn); + sema_init(&cobd->sem, 1); + + OBD_ALLOC(cobd->master_name, lcfg->lcfg_inllen1); + if (!cobd->master_name) + RETURN(-ENOMEM); + memcpy(cobd->master_name, lcfg->lcfg_inlbuf1, + lcfg->lcfg_inllen1); - cobd->cache_on = 1; - if (!strcmp(real->obd_type->typ_name, LUSTRE_MDC_NAME)) { - /* set mds_num for lustre */ - int mds_num; - mds_num = REAL_MDS_NUMBER; - obd_set_info(cobd->cobd_real_exp, strlen("mds_num"), - "mds_num", sizeof(mds_num), &mds_num); - mds_num = CACHE_MDS_NUMBER; - obd_set_info(cobd->cobd_cache_exp, strlen("mds_num"), - "mds_num", sizeof(mds_num), &mds_num); - } - /*default write to real obd*/ -exit: + OBD_ALLOC(cobd->cache_name, lcfg->lcfg_inllen2); + if (!cobd->cache_name) + GOTO(put_names, rc = -ENOMEM); + memcpy(cobd->cache_name, lcfg->lcfg_inlbuf2, + lcfg->lcfg_inllen2); + + EXIT; +put_names: if (rc) { - if (cobd->cobd_cache_name) - OBD_FREE(cobd->cobd_cache_name, - strlen(cobd->cobd_cache_name) + 1); - if (cobd->cobd_real_name) - OBD_FREE(cobd->cobd_real_name, - strlen(cobd->cobd_real_name) + 1); + OBD_FREE(cobd->master_name, lcfg->lcfg_inllen1); + cobd->master_name = NULL; } - RETURN(rc); + return rc; } static int cobd_cleanup(struct obd_device *obd, int flags) { struct cache_obd *cobd = &obd->u.cobd; - int rc; + ENTRY; if (!list_empty(&obd->obd_exports)) - return (-EBUSY); + RETURN(-EBUSY); + + if (cobd->cache_name) + OBD_FREE(cobd->cache_name, + strlen(cobd->cache_name) + 1); + if (cobd->master_name) + OBD_FREE(cobd->master_name, + strlen(cobd->master_name) + 1); - if (cobd->cobd_cache_name) - OBD_FREE(cobd->cobd_cache_name, - strlen(cobd->cobd_cache_name) + 1); - if (cobd->cobd_real_name) - OBD_FREE(cobd->cobd_real_name, - strlen(cobd->cobd_real_name) + 1); - if (cobd->cache_on) { - rc = obd_disconnect(cobd->cobd_cache_exp, flags); - if (rc != 0) - CERROR("error %d disconnecting cache\n", rc); - } - rc = obd_disconnect(cobd->cobd_real_exp, flags); - if (rc != 0) - CERROR("error %d disconnecting real\n", rc); + RETURN(0); +} + +static inline struct obd_export * +cobd_get_exp(struct obd_device *obd) +{ + struct cache_obd *cobd = &obd->u.cobd; + if (cobd->cache_on) + return cobd->cache_exp; + return cobd->master_exp; +} + +static int client_obd_connect(struct obd_device *obd, char *name, + struct lustre_handle *conn, + struct obd_connect_data *data, + unsigned long flags) +{ + struct obd_device *cli_obd; + int rc = 0; + ENTRY; + + LASSERT(obd); + LASSERT(name); + LASSERT(conn); - return (rc); + cli_obd = class_name2obd(name); + if (cli_obd == NULL) { + CERROR("%s: unable to find a client for obd: %s\n", + obd->obd_name, name); + RETURN(-EINVAL); + } + rc = obd_connect(conn, cli_obd, &obd->obd_uuid, data, flags); + if (rc) { + CERROR("error connecting to %s, err %d\n", + name, rc); + } + RETURN(rc); } -struct obd_export *cobd_get_exp(struct obd_device *obd) +static int client_obd_disconnect(struct obd_device *obd, + struct obd_export *exp, + unsigned long flags) { - struct cache_obd *cobd = &obd->u.cobd; + struct obd_device *cli_obd; + int rc = 0; + ENTRY; + + cli_obd = class_exp2obd(exp); + cli_obd->obd_no_recov = obd->obd_no_recov; - if (cobd->cache_on) - return cobd->cobd_cache_exp; - else - return cobd->cobd_real_exp; + rc = obd_disconnect(exp, flags); + if (rc) { + CERROR("error disconnecting from %s, err %d\n", + cli_obd->obd_name, rc); + class_export_put(exp); + } + RETURN(rc); } static int cobd_connect(struct lustre_handle *conn, struct obd_device *obd, - struct obd_uuid *cluuid, unsigned long connect_flags) + struct obd_uuid *cluuid, struct obd_connect_data *data, + unsigned long flags) { - int rc; + struct lustre_handle cache_conn = { 0 }; + struct cache_obd *cobd = &obd->u.cobd; + struct obd_export *exp; + int rc = 0; + ENTRY; + + /* connecting class */ rc = class_connect(conn, obd, cluuid); - return rc; + if (rc) + RETURN(rc); + exp = class_conn2export(conn); + + /* connecting cache */ + rc = client_obd_connect(obd, cobd->cache_name, + &cache_conn, data, flags); + if (rc) + GOTO(err_discon, rc); + cobd->cache_exp = class_conn2export(&cache_conn); + cobd->cache_on = 1; + + EXIT; +err_discon: + if (rc) + class_disconnect(exp, 0); + else + class_export_put(exp); + return rc; } -static int cobd_disconnect(struct obd_export *exp, int flags) +static int +cobd_disconnect(struct obd_export *exp, unsigned long flags) { - int rc; - rc = class_disconnect(exp, 0); - return rc; + struct obd_device *obd; + struct cache_obd *cobd; + int rc = 0; + ENTRY; + + LASSERT(exp != NULL); + obd = class_exp2obd(exp); + if (obd == NULL) { + CDEBUG(D_IOCTL, "invalid client cookie "LPX64"\n", + exp->exp_handle.h_cookie); + RETURN(-EINVAL); + } + + cobd = &obd->u.cobd; + + if (cobd->cache_on) { + rc = client_obd_disconnect(obd, cobd->cache_exp, + flags); + cobd->cache_exp = NULL; + } else { + rc = client_obd_disconnect(obd, cobd->master_exp, + flags); + cobd->master_exp = NULL; + } + + rc = class_disconnect(exp, flags); + RETURN(rc); } static int cobd_get_info(struct obd_export *exp, obd_count keylen, @@ -206,14 +242,15 @@ static int cobd_get_info(struct obd_export *exp, obd_count keylen, { struct obd_device *obd = class_exp2obd(exp); struct obd_export *cobd_exp; + if (obd == NULL) { CERROR("invalid client cookie "LPX64"\n", exp->exp_handle.h_cookie); return -EINVAL; } cobd_exp = cobd_get_exp(obd); - /* intercept cache utilisation info? */ + /* intercept cache utilisation info? */ return obd_get_info(cobd_exp, keylen, key, vallen, val); } @@ -229,8 +266,8 @@ static int cobd_set_info(struct obd_export *exp, obd_count keylen, return -EINVAL; } cobd_exp = cobd_get_exp(obd); + /* intercept cache utilisation info? */ - return obd_set_info(cobd_exp, keylen, key, vallen, val); } @@ -311,12 +348,12 @@ static int cobd_destroy(struct obd_export *exp, struct obdo *obdo, static int cobd_precleanup(struct obd_device *obd, int flags) { - /*FIXME Do we need some cleanup here?*/ + /* FIXME-WANGDI: do we need some cleanup here? */ return 0; } static int cobd_getattr(struct obd_export *exp, struct obdo *oa, - struct lov_stripe_md *lsm) + struct lov_stripe_md *ea) { struct obd_device *obd = class_exp2obd(exp); struct obd_export *cobd_exp; @@ -327,12 +364,12 @@ static int cobd_getattr(struct obd_export *exp, struct obdo *oa, return -EINVAL; } cobd_exp = cobd_get_exp(obd); - return obd_getattr(cobd_exp, oa, lsm); + return obd_getattr(cobd_exp, oa, ea); } static int cobd_getattr_async(struct obd_export *exp, - struct obdo *obdo, struct lov_stripe_md *ea, - struct ptlrpc_request_set *set) + struct obdo *obdo, struct lov_stripe_md *ea, + struct ptlrpc_request_set *set) { struct obd_device *obd = class_exp2obd(exp); struct obd_export *cobd_exp; @@ -362,7 +399,8 @@ static int cobd_setattr(struct obd_export *exp, struct obdo *obdo, return obd_setattr(cobd_exp, obdo, ea, oti); } -static int cobd_md_getstatus(struct obd_export *exp, struct ll_fid *rootfid) +static int cobd_md_getstatus(struct obd_export *exp, + struct lustre_id *rootid) { struct obd_device *obd = class_exp2obd(exp); struct obd_export *cobd_exp; @@ -373,7 +411,7 @@ static int cobd_md_getstatus(struct obd_export *exp, struct ll_fid *rootfid) return -EINVAL; } cobd_exp = cobd_get_exp(obd); - return md_getstatus(cobd_exp, rootfid); + return md_getstatus(cobd_exp, rootid); } static int cobd_brw(int cmd, struct obd_export *exp, struct obdo *oa, @@ -435,7 +473,7 @@ static int cobd_queue_async_io(struct obd_export *exp, struct lov_stripe_md *lsm, struct lov_oinfo *loi, void *cookie, int cmd, obd_off off, int count, - obd_flag brw_flags, obd_flag async_flags) + obd_flags brw_flags, obd_flags async_flags) { struct obd_device *obd = class_exp2obd(exp); struct obd_export *cobd_exp; @@ -453,7 +491,7 @@ static int cobd_queue_async_io(struct obd_export *exp, static int cobd_set_async_flags(struct obd_export *exp, struct lov_stripe_md *lsm, struct lov_oinfo *loi, void *cookie, - obd_flag async_flags) + obd_flags async_flags) { struct obd_device *obd = class_exp2obd(exp); struct obd_export *cobd_exp; @@ -472,8 +510,8 @@ static int cobd_queue_group_io(struct obd_export *exp, struct lov_oinfo *loi, struct obd_io_group *oig, void *cookie, int cmd, obd_off off, - int count, obd_flag brw_flags, - obd_flag async_flags) + int count, obd_flags brw_flags, + obd_flags async_flags) { struct obd_device *obd = class_exp2obd(exp); struct obd_export *cobd_exp; @@ -675,58 +713,55 @@ static int cobd_commitrw(int cmd, struct obd_export *exp, struct obdo *oa, static int cobd_flush(struct obd_device *obd) { - /*FLUSH the filesystem from the cache - *to the real device */ return 0; } -static int cobd_iocontrol(unsigned int cmd, struct obd_export *exp, int len, - void *karg, void *uarg) +static int cobd_iocontrol(unsigned int cmd, struct obd_export *exp, + int len, void *karg, void *uarg) { struct obd_device *obd = class_exp2obd(exp); struct cache_obd *cobd = &obd->u.cobd; - struct obd_device *real_dev = NULL; struct obd_export *cobd_exp; int rc = 0; - + ENTRY; + + down(&cobd->sem); + switch (cmd) { case OBD_IOC_COBD_CON: if (!cobd->cache_on) { - struct lustre_handle cache_conn = {0,}; - - rc = obd_disconnect(cobd->cobd_real_exp, 0); - if (rc != 0) - CERROR("error %d disconnecting real\n", rc); - rc = connect_to_obd(cobd->cobd_cache_name, &cache_conn); - if (rc != 0) - RETURN(rc); - cobd->cobd_cache_exp = class_conn2export(&cache_conn); - + struct lustre_handle conn = {0}; + + rc = client_obd_disconnect(obd, cobd->master_exp, 0); + rc = client_obd_connect(obd, cobd->cache_name, &conn, + NULL, 0); + if (rc) + GOTO(out, rc); + cobd->cache_exp = class_conn2export(&conn); cobd->cache_on = 1; } break; case OBD_IOC_COBD_COFF: if (cobd->cache_on) { - struct lustre_handle real_conn = {0,}; - struct obd_device *cache_dev = NULL; - int m_easize, m_cooksize; - - cache_dev = class_exp2obd(cobd->cobd_cache_exp); - m_easize = cache_dev->u.cli.cl_max_mds_easize; - m_cooksize = cache_dev->u.cli.cl_max_mds_cookiesize; - rc = obd_disconnect(cobd->cobd_cache_exp, 0); - if (rc != 0) - CERROR("error %d disconnecting real\n", rc); - - /*FIXME, should read from real_dev*/ + struct lustre_handle conn = {0,}; + struct obd_device *master = NULL; + struct obd_device *cache = NULL; + int easize, cooksize; + + cache = class_exp2obd(cobd->cache_exp); + easize = cache->u.cli.cl_max_mds_easize; + cooksize = cache->u.cli.cl_max_mds_cookiesize; - rc = connect_to_obd(cobd->cobd_real_name, &real_conn); - if (rc != 0) - RETURN(rc); - cobd->cobd_real_exp = class_conn2export(&real_conn); - real_dev = class_exp2obd(cobd->cobd_real_exp); - real_dev->u.cli.cl_max_mds_easize = m_easize; - real_dev->u.cli.cl_max_mds_cookiesize = m_cooksize; + rc = client_obd_disconnect(obd, cobd->cache_exp, 0); + rc = client_obd_connect(obd, cobd->master_name, &conn, + NULL, 0); + if (rc) + GOTO(out, rc); + cobd->master_exp = class_conn2export(&conn); + + master = class_exp2obd(cobd->master_exp); + master->u.cli.cl_max_mds_easize = easize; + master->u.cli.cl_max_mds_cookiesize = cooksize; cobd->cache_on = 0; } break; @@ -734,13 +769,18 @@ static int cobd_iocontrol(unsigned int cmd, struct obd_export *exp, int len, if (cobd->cache_on) { cobd->cache_on = 0; cobd_flush(obd); + } else { + CERROR("%s: cache is turned off\n", obd->obd_name); } break; default: cobd_exp = cobd_get_exp(obd); rc = obd_iocontrol(cmd, cobd_exp, len, karg, uarg); } - + + EXIT; +out: + up(&cobd->sem); return rc; } @@ -833,9 +873,9 @@ static int cobd_import_event(struct obd_device *obd, return 0; } -static int cobd_md_getattr(struct obd_export *exp, struct ll_fid *fid, - unsigned long valid, unsigned int ea_size, - struct ptlrpc_request **request) +static int cobd_md_getattr(struct obd_export *exp, struct lustre_id *id, + __u64 valid, const char *ea_name, int ea_namelen, + unsigned int ea_size, struct ptlrpc_request **request) { struct obd_device *obd = class_exp2obd(exp); struct obd_export *cobd_exp; @@ -846,7 +886,7 @@ static int cobd_md_getattr(struct obd_export *exp, struct ll_fid *fid, return -EINVAL; } cobd_exp = cobd_get_exp(obd); - return md_getattr(cobd_exp, fid, valid, ea_size, request); + return md_getattr(cobd_exp, id, valid, NULL, 0, ea_size, request); } static int cobd_md_req2lustre_md (struct obd_export *mdc_exp, @@ -865,7 +905,7 @@ static int cobd_md_req2lustre_md (struct obd_export *mdc_exp, return md_req2lustre_md(cobd_exp, req, offset, osc_exp, md); } -static int cobd_md_change_cbdata(struct obd_export *exp, struct ll_fid *fid, +static int cobd_md_change_cbdata(struct obd_export *exp, struct lustre_id *id, ldlm_iterator_t it, void *data) { struct obd_device *obd = class_exp2obd(exp); @@ -877,14 +917,12 @@ static int cobd_md_change_cbdata(struct obd_export *exp, struct ll_fid *fid, return -EINVAL; } cobd_exp = cobd_get_exp(obd); - return md_change_cbdata(cobd_exp, fid, it, data); + return md_change_cbdata(cobd_exp, id, it, data); } -static int cobd_md_getattr_name(struct obd_export *exp, struct ll_fid *fid, - char *filename, int namelen, - unsigned long valid, - unsigned int ea_size, - struct ptlrpc_request **request) +static int cobd_md_getattr_lock(struct obd_export *exp, struct lustre_id *id, + char *filename, int namelen, __u64 valid, + unsigned int ea_size, struct ptlrpc_request **request) { struct obd_device *obd = class_exp2obd(exp); struct obd_export *cobd_exp; @@ -895,7 +933,7 @@ static int cobd_md_getattr_name(struct obd_export *exp, struct ll_fid *fid, return -EINVAL; } cobd_exp = cobd_get_exp(obd); - return md_getattr_name(cobd_exp, fid, filename, namelen, valid, + return md_getattr_lock(cobd_exp, id, filename, namelen, valid, ea_size, request); } @@ -932,7 +970,8 @@ static int cobd_md_unlink(struct obd_export *exp, struct mdc_op_data *data, return md_unlink(cobd_exp, data, request); } -static int cobd_md_valid_attrs(struct obd_export *exp, struct ll_fid *fid) +static int cobd_md_valid_attrs(struct obd_export *exp, + struct lustre_id *id) { struct obd_device *obd = class_exp2obd(exp); struct obd_export *cobd_exp; @@ -943,7 +982,7 @@ static int cobd_md_valid_attrs(struct obd_export *exp, struct ll_fid *fid) return -EINVAL; } cobd_exp = cobd_get_exp(obd); - return md_valid_attrs(cobd_exp, fid); + return md_valid_attrs(cobd_exp, id); } static int cobd_md_rename(struct obd_export *exp, struct mdc_op_data *data, @@ -993,7 +1032,8 @@ static int cobd_md_setattr(struct obd_export *exp, struct mdc_op_data *data, return md_setattr(cobd_exp, data, iattr, ea, ealen, ea2, ea2len, request); } -static int cobd_md_readpage(struct obd_export *exp, struct ll_fid *mdc_fid, +static int cobd_md_readpage(struct obd_export *exp, + struct lustre_id *mdc_id, __u64 offset, struct page *page, struct ptlrpc_request **request) { @@ -1006,7 +1046,7 @@ static int cobd_md_readpage(struct obd_export *exp, struct ll_fid *mdc_fid, return -EINVAL; } cobd_exp = cobd_get_exp(obd); - return md_readpage(cobd_exp, mdc_fid, offset, page, request); + return md_readpage(cobd_exp, mdc_id, offset, page, request); } static int cobd_md_close(struct obd_export *exp, struct obdo *obdo, @@ -1039,7 +1079,7 @@ static int cobd_md_done_writing(struct obd_export *exp, struct obdo *obdo) return md_done_writing(cobd_exp, obdo); } -static int cobd_md_sync(struct obd_export *exp, struct ll_fid *fid, +static int cobd_md_sync(struct obd_export *exp, struct lustre_id *id, struct ptlrpc_request **request) { struct obd_device *obd = class_exp2obd(exp); @@ -1052,7 +1092,7 @@ static int cobd_md_sync(struct obd_export *exp, struct ll_fid *fid, } cobd_exp = cobd_get_exp(obd); - return md_sync(cobd_exp, fid, request); + return md_sync(cobd_exp, id, request); } static int cobd_md_set_open_replay_data(struct obd_export *exp, @@ -1141,10 +1181,9 @@ static int cobd_md_enqueue(struct obd_export *exp, int lock_type, cb_data); } -static int cobd_md_intent_lock(struct obd_export *exp, - struct ll_fid *pfid, const char *name, int len, - void *lmm, int lmmsize, - struct ll_fid *cfid, struct lookup_intent *it, +static int cobd_md_intent_lock(struct obd_export *exp, struct lustre_id *pid, + const char *name, int len, void *lmm, int lmmsize, + struct lustre_id *cid, struct lookup_intent *it, int lookup_flags, struct ptlrpc_request **reqp, ldlm_blocking_callback cb_blocking) { @@ -1157,12 +1196,12 @@ static int cobd_md_intent_lock(struct obd_export *exp, return -EINVAL; } cobd_exp = cobd_get_exp(obd); - return md_intent_lock(cobd_exp, pfid, name, len, lmm, lmmsize, - cfid, it, lookup_flags, reqp, cb_blocking); + return md_intent_lock(cobd_exp, pid, name, len, lmm, lmmsize, + cid, it, lookup_flags, reqp, cb_blocking); } -static struct obd_device * cobd_md_get_real_obd(struct obd_export *exp, - char *name, int len) +static struct obd_device *cobd_md_get_real_obd(struct obd_export *exp, + struct lustre_id *id) { struct obd_device *obd = class_exp2obd(exp); struct obd_export *cobd_exp; @@ -1173,12 +1212,12 @@ 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, - struct ll_fid *fid, char *name, - int namelen, struct ll_fid *fid2, + struct lustre_id *id, char *name, + int namelen, struct lustre_id *id2, ldlm_iterator_t it, void *data) { struct obd_device *obd = class_exp2obd(exp); @@ -1190,8 +1229,8 @@ static int cobd_md_change_cbdata_name(struct obd_export *exp, return -EINVAL; } cobd_exp = cobd_get_exp(obd); - return md_change_cbdata_name(cobd_exp, fid, name, namelen, fid2, it, - data); + return md_change_cbdata_name(cobd_exp, id, name, namelen, + id2, it, data); } static struct obd_ops cobd_obd_ops = { .o_owner = THIS_MODULE, @@ -1246,7 +1285,7 @@ struct md_ops cobd_md_ops = { .m_getattr = cobd_md_getattr, .m_req2lustre_md = cobd_md_req2lustre_md, .m_change_cbdata = cobd_md_change_cbdata, - .m_getattr_name = cobd_md_getattr_name, + .m_getattr_lock = cobd_md_getattr_lock, .m_create = cobd_md_create, .m_unlink = cobd_md_unlink, .m_valid_attrs = cobd_md_valid_attrs,