From: nikita Date: Fri, 4 Aug 2006 15:22:16 +0000 (+0000) Subject: cleanup: do not access ->loh_fid directly X-Git-Tag: v1_8_0_110~486^2~1273 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=e5cf7c63adfa410ce7d063903223a6d7f5af28a9;p=fs%2Flustre-release.git cleanup: do not access ->loh_fid directly --- diff --git a/lustre/mdd/mdd_lov.c b/lustre/mdd/mdd_lov.c index 9bed82f..f301d0e 100644 --- a/lustre/mdd/mdd_lov.c +++ b/lustre/mdd/mdd_lov.c @@ -163,7 +163,7 @@ static int mdd_lov_update(struct obd_device *host, struct md_device *upcall_dev; int rc; ENTRY; - + LASSERT(owner != NULL); obd = mdd2_obd(mdd); @@ -175,7 +175,7 @@ static int mdd_lov_update(struct obd_device *host, } /*The obd is created for handling data stack for mdd*/ -int mdd_init_obd(const struct lu_context *ctxt, struct mdd_device *mdd, +int mdd_init_obd(const struct lu_context *ctxt, struct mdd_device *mdd, char *dev) { struct lustre_cfg_bufs bufs; @@ -329,7 +329,7 @@ int mdd_lov_set_md(const struct lu_context *ctxt, struct md_object *pobj, RETURN(rc); } -/*FIXME: this is for create lsm object id, which should identify the +/*FIXME: this is for create lsm object id, which should identify the * lsm object unique in the whole mds, as I see. But it seems, we * still not need it now. right? so just borrow the ll_fid_build_ino */ @@ -339,7 +339,7 @@ static obd_id mdd_lov_create_id(struct lu_fid *fid) } int mdd_lov_create(const struct lu_context *ctxt, struct mdd_device *mdd, - struct mdd_object *parent, struct mdd_object *child, + struct mdd_object *parent, struct mdd_object *child, struct lov_mds_md **lmm, int *lmm_size, const void *eadata, int eadatasize, struct lu_attr *la) { @@ -359,7 +359,7 @@ int mdd_lov_create(const struct lu_context *ctxt, struct mdd_device *mdd, oa->o_uid = 0; /* must have 0 uid / gid on OST */ oa->o_gid = 0; oa->o_mode = S_IFREG | 0600; - oa->o_id = mdd_lov_create_id(&mdd2lu_obj(child)->lo_header->loh_fid); + oa->o_id = mdd_lov_create_id(lu_object_fid(mdd2lu_obj(child))); oa->o_valid = OBD_MD_FLID | OBD_MD_FLTYPE | OBD_MD_FLFLAGS | OBD_MD_FLMODE | OBD_MD_FLUID | OBD_MD_FLGID; oa->o_size = 0; @@ -373,7 +373,7 @@ int mdd_lov_create(const struct lu_context *ctxt, struct mdd_device *mdd, GOTO(out_oa, rc); } else { LASSERT(*lmm == NULL); - rc = mdd_get_md(ctxt, &parent->mod_obj, *lmm, + rc = mdd_get_md(ctxt, &parent->mod_obj, *lmm, lmm_size); if (rc > 0) rc = obd_iocontrol(OBD_IOC_LOV_SETSTRIPE, @@ -390,7 +390,7 @@ int mdd_lov_create(const struct lu_context *ctxt, struct mdd_device *mdd, } } else { LASSERT(eadata != NULL); - rc = obd_iocontrol(OBD_IOC_LOV_SETEA, lov_exp, 0, &lsm, + rc = obd_iocontrol(OBD_IOC_LOV_SETEA, lov_exp, 0, &lsm, (void*)eadata); if (rc) { GOTO(out_oa, rc); @@ -410,11 +410,11 @@ out_oa: RETURN(rc); } -int mdd_unlink_log(const struct lu_context *ctxt, struct mdd_device *mdd, +int mdd_unlink_log(const struct lu_context *ctxt, struct mdd_device *mdd, struct mdd_object *mdd_cobj, struct md_attr *ma) { struct obd_device *obd = mdd2_obd(mdd); - + if (mds_log_op_unlink(obd, NULL, ma->ma_lmm, ma->ma_lmm_size, ma->ma_cookie, ma->ma_cookie_size)) { ma->ma_valid |= MA_COOKIE; @@ -426,7 +426,7 @@ int mdd_lov_mdsize(const struct lu_context *ctxt, struct mdd_device *mdd, int *md_size) { struct obd_device *obd = mdd2_obd(mdd); - *md_size = obd->u.mds.mds_max_mdsize; + *md_size = obd->u.mds.mds_max_mdsize; RETURN(0); } diff --git a/lustre/mdt/mdt_fs.c b/lustre/mdt/mdt_fs.c index bf9d7c2..62cbf3e 100644 --- a/lustre/mdt/mdt_fs.c +++ b/lustre/mdt/mdt_fs.c @@ -448,7 +448,7 @@ static int mdt_txn_stop_cb(const struct lu_context *ctx, mti->mti_transno = ++ mdt->mdt_last_transno; } else { /* replay */ - CDEBUG(D_HA, "replaying transno: "LPD64" stopped\n", + CDEBUG(D_HA, "replaying transno: "LPD64" stopped\n", mti->mti_transno); if (mti->mti_transno > mdt->mdt_last_transno) mdt->mdt_last_transno = mti->mti_transno; diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 6160087..188bdb0 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -2411,7 +2411,7 @@ static int mdt_object_init(const struct lu_context *ctxt, struct lu_object *o) ENTRY; CDEBUG(D_INODE, "object init, fid = "DFID3"\n", - PFID3(&o->lo_header->loh_fid)); + PFID3(lu_object_fid(o))); under = &d->mdt_child->md_lu_dev; below = under->ld_ops->ldo_object_alloc(ctxt, o->lo_header, under); @@ -2429,7 +2429,8 @@ static void mdt_object_free(const struct lu_context *ctxt, struct lu_object *o) ENTRY; h = o->lo_header; - CDEBUG(D_INODE, "object free, fid = "DFID3"\n", PFID3(&h->loh_fid)); + CDEBUG(D_INODE, "object free, fid = "DFID3"\n", + PFID3(lu_object_fid(o))); lu_object_fini(o); lu_object_header_fini(h); diff --git a/lustre/mdt/mdt_lib.c b/lustre/mdt/mdt_lib.c index 914c8e9..bd01196 100644 --- a/lustre/mdt/mdt_lib.c +++ b/lustre/mdt/mdt_lib.c @@ -152,8 +152,7 @@ static int mdt_setattr_unpack(struct mdt_thread_info *info) if (req_capsule_field_present(pill, &RMF_EADATA)) { rr->rr_eadata = req_capsule_client_get(pill, &RMF_EADATA); - rr->rr_eadatalen = req_capsule_get_size(pill, - &RMF_EADATA, + rr->rr_eadatalen = req_capsule_get_size(pill, &RMF_EADATA, RCL_CLIENT); } if (req_capsule_field_present(pill, &RMF_LOGCOOKIES)) { diff --git a/lustre/mdt/mdt_open.c b/lustre/mdt/mdt_open.c index a20f9cf..9769c27 100644 --- a/lustre/mdt/mdt_open.c +++ b/lustre/mdt/mdt_open.c @@ -277,11 +277,9 @@ int mdt_reint_open(struct mdt_thread_info *info) if (result) RETURN(result); - ma->ma_lmm = req_capsule_server_get(&info->mti_pill, - &RMF_MDT_MD); + ma->ma_lmm = req_capsule_server_get(&info->mti_pill, &RMF_MDT_MD); ma->ma_lmm_size = req_capsule_get_size(&info->mti_pill, - &RMF_MDT_MD, - RCL_SERVER); + &RMF_MDT_MD, RCL_SERVER); if (rr->rr_name[0] == 0) { /* reint partial remote open */