Whamcloud - gitweb
parallel llog init
[fs/lustre-release.git] / lustre / ptlrpc / llog_server.c
index da21e87..93c03ec 100644 (file)
@@ -560,7 +560,6 @@ static int llog_catinfo_deletions(struct obd_device *obd, char *buf,
         struct lvfs_run_ctxt saved;
         int size, i, count;
         struct llog_catid *idarray;
-        struct llog_logid *id;
         char name[32] = CATLIST;
         struct cb_data data;
         struct llog_ctxt *ctxt = llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT);
@@ -572,11 +571,11 @@ static int llog_catinfo_deletions(struct obd_device *obd, char *buf,
         count = mds->mds_lov_desc.ld_tgt_count;
         size = sizeof(*idarray) * count;
 
-        OBD_ALLOC(idarray, size);
+        OBD_VMALLOC(idarray, size);
         if (!idarray)
                 GOTO(release_ctxt, rc = -ENOMEM);
 
-        rc = llog_get_cat_list(obd, obd, name, count, idarray);
+        rc = llog_get_cat_list(obd, obd, name, 0, count, idarray);
         if (rc)
                 GOTO(out_free, rc);
 
@@ -588,8 +587,7 @@ static int llog_catinfo_deletions(struct obd_device *obd, char *buf,
         for (i = 0; i < count; i++) {
                 int l, index, uncanceled = 0;
 
-                id = &idarray[i].lci_logid;
-                rc = llog_create(ctxt, &handle, id, NULL);
+                rc = llog_create(ctxt, &handle, &idarray[i].lci_logid, NULL);
                 if (rc)
                         GOTO(out_pop, rc);
                 rc = llog_init_handle(handle, 0, NULL);
@@ -604,8 +602,9 @@ static int llog_catinfo_deletions(struct obd_device *obd, char *buf,
                 l = snprintf(data.out, data.remains,
                              "\n[Catlog ID]: #"LPX64"#"LPX64"#%08x  "
                              "[Log Count]: %d\n",
-                             id->lgl_oid, id->lgl_ogr, id->lgl_ogen,
-                             uncanceled);
+                             idarray[i].lci_logid.lgl_oid,
+                             idarray[i].lci_logid.lgl_ogr,
+                             idarray[i].lci_logid.lgl_ogen, uncanceled);
 
                 data.out += l;
                 data.remains -= l;
@@ -617,14 +616,15 @@ static int llog_catinfo_deletions(struct obd_device *obd, char *buf,
                 if (data.remains <= 0)
                         break;
         }
+        EXIT;
 out_pop:
         pop_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_lvfs_ctxt, NULL);
 out_free:
-        OBD_FREE(idarray, size);
+        OBD_VFREE(idarray, size);
 release_ctxt:
         llog_ctxt_put(ctxt);
 
-        RETURN(rc);
+        return(rc);
 }
 
 int llog_catinfo(struct ptlrpc_request *req)