Whamcloud - gitweb
Update based on lustre-iokit-20051107.tar.gz from the customer download area.
[fs/lustre-release.git] / lustre / lmv / lmv_objmgr.c
index ecce7a0..adaa0e4 100644 (file)
@@ -297,18 +297,20 @@ lmv_create_obj(struct obd_export *exp, struct lustre_id *id, struct mea *mea)
         CDEBUG(D_OTHER, "get mea for "DLID4" and create lmv obj\n",
                OLID4(id));
 
-        if (!mea) {
-                unsigned long valid;
+        md.mea = NULL;
+       
+        if (mea == NULL) {
+                __u64 valid;
                 
                 CDEBUG(D_OTHER, "mea isn't passed in, get it now\n");
                 mealen = MEA_SIZE_LMV(lmv);
                 
                 /* time to update mea of parent id */
                 md.mea = NULL;
-                valid = OBD_MD_FLEASIZE | OBD_MD_FLDIREA;
+                valid = OBD_MD_FLEASIZE | OBD_MD_FLDIREA | OBD_MD_MEA;
 
                 rc = md_getattr(lmv->tgts[id_group(id)].ltd_exp,
-                                id, valid, mealen, &req);
+                                id, valid, NULL, NULL, 0, mealen, NULL, &req);
                 if (rc) {
                         CERROR("md_getattr() failed, error %d\n", rc);
                         GOTO(cleanup, obj = ERR_PTR(rc));
@@ -320,7 +322,7 @@ lmv_create_obj(struct obd_export *exp, struct lustre_id *id, struct mea *mea)
                         GOTO(cleanup, obj = ERR_PTR(rc));
                 }
 
-                if (!md.mea)
+                if (md.mea == NULL)
                         GOTO(cleanup, obj = ERR_PTR(-ENODATA));
                         
                 mea = md.mea;
@@ -333,7 +335,11 @@ lmv_create_obj(struct obd_export *exp, struct lustre_id *id, struct mea *mea)
                        OLID4(id));
                 GOTO(cleanup, obj = ERR_PTR(-ENOMEM));
         }
-        EXIT;
+       
+       if (md.mea != NULL)
+               obd_free_memmd(exp, (struct lov_stripe_md **)&md.mea);
+        
+       EXIT;
 cleanup:
         if (req)
                 ptlrpc_req_finished(req);