]> mj.ucw.cz Git - libucw.git/commitdiff
Added a quick-check mode which does bucket file checks done during normal open
authorMartin Mares <mj@ucw.cz>
Mon, 26 Aug 2002 13:47:03 +0000 (13:47 +0000)
committerMartin Mares <mj@ucw.cz>
Mon, 26 Aug 2002 13:47:03 +0000 (13:47 +0000)
(i.e., the trailer check).

lib/buckettool.c

index dbfe67043b91ef5f6dde9be4fb567a741ab1667d..b2f51715828e702e0c5eb013dc67abea1dbb8f0f 100644 (file)
@@ -38,6 +38,7 @@ CF_USAGE
 -c\t\tconcatenate and dump all buckets\n\
 -f\t\taudit bucket file structure\n\
 -F\t\taudit and fix bucket file structure\n\
+-q\t\tquick check of bucket file consistency\n\
 -s\t\tshake down bucket file (without updating other structures!!!)\n\
 -v\t\tbe verbose\n\
 ");
@@ -265,6 +266,13 @@ shake(void)
   obuck_cleanup();
 }
 
+static void
+quickcheck(void)
+{
+  obuck_init(1);
+  obuck_cleanup();
+}
+
 int
 main(int argc, char **argv)
 {
@@ -273,7 +281,7 @@ main(int argc, char **argv)
 
   log_init(NULL);
   op = 0;
-  while ((i = cf_getopt(argc, argv, CF_SHORT_OPTS "lLd:x:icfFsv", CF_NO_LONG_OPTS, NULL)) != -1)
+  while ((i = cf_getopt(argc, argv, CF_SHORT_OPTS "lLd:x:icfFqsv", CF_NO_LONG_OPTS, NULL)) != -1)
     if (i == '?' || op)
       help();
     else if (i == 'v')
@@ -312,6 +320,9 @@ main(int argc, char **argv)
     case 'F':
       fsck(1);
       break;
+    case 'q':
+      quickcheck();
+      break;
     case 's':
       shake();
       break;