Author: adrian.chadd
Date: Tue Apr 21 08:33:23 2009
New Revision: 13974
Modified:
branches/LUSCA_HEAD/tools/ufsdump.c
Log:
Flesh out "LFS" meta printing and tidy up the format.
Modified: branches/LUSCA_HEAD/tools/ufsdump.c
==============================================================================
--- branches/LUSCA_HEAD/tools/ufsdump.c (original)
+++ branches/LUSCA_HEAD/tools/ufsdump.c Tue Apr 21 08:33:23 2009
@@ -30,6 +30,7 @@
#include "../libsqtlv/tlv.h"
#include "../libsqstore/store_mgr.h"
+#include "../libsqstore/store_meta.h"
#define BUFSIZE 4096
@@ -52,6 +53,15 @@
return buf;
}
+void
+storeMetaNew(char *buf, int len)
+{
+ storeMetaIndexNew *sn;
+
+ sn = (storeMetaIndexNew *) buf;
+ printf(" SWAP_META_STD_LFS: mlen %d, size %d, timestamp %ld,
lastref %ld,
expires %ld, lastmod %ld, file size %ld, refcount %d, flags %d\n", len,
sizeof(storeMetaIndexNew), sn->timestamp, sn->lastref, sn->expires,
sn->lastmod, sn->swap_file_sz, sn->refcount, sn->flags);
+}
+
static void
parse_header(char *buf, int len)
{
@@ -72,14 +82,17 @@
switch (t->type) {
case STORE_META_URL:
/* XXX Is this OK? Is the URL guaranteed to be \0 terminated? */
- printf(" URL: %s\n", (char *) t->value);
+ printf(" STORE_META_URL: %s\n", (char *) t->value);
break;
case STORE_META_KEY_MD5:
- printf(" MD5 key: %s\n", storeKeyText( (unsigned char *)
t->value ) );
+ printf(" STORE_META_KEY_MD5: %s\n", storeKeyText(
(unsigned char *)
t->value ) );
+ break;
+ case STORE_META_STD_LFS:
+ storeMetaNew( (char *) t->value, t->length);
break;
case STORE_META_OBJSIZE:
l = t->value;
- printf("\tSize: %" PRINTF_OFF_T " (len %d)\n", *l,
t->length);
+ printf("\tSTORE_META_OBJSIZE: %" PRINTF_OFF_T " (len
%d)\n", *l,
t->length);
break;
default:
printf("\tType: %d; Length %d\n", t->type, (int) t->length);
@@ -89,6 +102,7 @@
//printf(" STRIPE: Completed, got an object with no size\n");
}
tlv_free(tlv_list);
+ printf("\n");
}
int
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"lusca-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/lusca-commit?hl=en
-~----------~----~----~----~------~----~------~--~---