+int lmv_get_mea_and_update_object(struct obd_export *exp, struct ll_fid *fid)
+{
+ struct obd_device *obd = exp->exp_obd;
+ struct lmv_obd *lmv = &obd->u.lmv;
+ struct ptlrpc_request *req = NULL;
+ struct lustre_md md;
+ int mealen, rc;
+
+ md.mea = NULL;
+ mealen = MEA_SIZE_LMV(lmv);
+
+ /* time to update mea of parent fid */
+ rc = md_getattr(lmv->tgts[fid->mds].exp, fid,
+ OBD_MD_FLEASIZE, mealen, &req);
+ if (rc)
+ GOTO(cleanup, rc);
+ rc = mdc_req2lustre_md(req, 0, NULL, exp, &md);
+ if (rc)
+ GOTO(cleanup, rc);
+ if (md.mea == NULL)
+ GOTO(cleanup, rc = -ENODATA);
+ rc = lmv_create_obj_from_attrs(exp, fid, md.mea);
+ obd_free_memmd(exp, (struct lov_stripe_md **) &md.mea);
+
+cleanup:
+ if (req)
+ ptlrpc_req_finished(req);
+ RETURN(rc);
+}
+