ctdb: add an option --print-recordflags to trigger printing record flags in catdb...
[rusty/ctdb.git] / tools / ctdb.c
index 10c11e4ccf626e49bf58b5e78f461cab0559f626..06e2a0b5d18447c0a2d42932fe081099d99f1922 100644 (file)
@@ -50,6 +50,7 @@ static struct {
        int printdatasize;
        int printlmaster;
        int printhash;
+       int printrecordflags;
 } options;
 
 #define TIMELIMIT() timeval_current_ofs(options.timelimit, 0)
@@ -3015,6 +3016,7 @@ static int control_catdb(struct ctdb_context *ctdb, int argc, const char **argv)
        c.printdatasize = (bool)options.printdatasize;
        c.printlmaster = (bool)options.printlmaster;
        c.printhash = (bool)options.printhash;
+       c.printrecordflags = (bool)options.printrecordflags;
 
        /* traverse and dump the cluster tdb */
        ret = ctdb_dump_db(ctdb_db, &c);
@@ -3049,6 +3051,7 @@ static int cattdb_traverse(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data,
        c.printdatasize = (bool)options.printdatasize;
        c.printlmaster = false;
        c.printhash = (bool)options.printhash;
+       c.printrecordflags = true;
 
        return ctdb_dumpdb_record(d->ctdb, key, data, &c);
 }
@@ -4619,6 +4622,7 @@ static int control_dumpdbbackup(struct ctdb_context *ctdb, int argc, const char
        c.printdatasize = (bool)options.printdatasize;
        c.printlmaster = false;
        c.printhash = (bool)options.printhash;
+       c.printrecordflags = (bool)options.printrecordflags;
 
        for (i=0; i < m->count; i++) {
                uint32_t reqid = 0;
@@ -5188,6 +5192,7 @@ int main(int argc, const char *argv[])
                { "print-datasize", 0, POPT_ARG_NONE, &options.printdatasize, 0, "do not print record data when dumping databases, only the data size", NULL },
                { "print-lmaster", 0, POPT_ARG_NONE, &options.printlmaster, 0, "print the record's lmaster in catdb", NULL },
                { "print-hash", 0, POPT_ARG_NONE, &options.printhash, 0, "print the record's hash when dumping databases", NULL },
+               { "print-recordflags", 0, POPT_ARG_NONE, &options.printrecordflags, 0, "print the record flags in catdb and dumpdbbackup", NULL },
                POPT_TABLEEND
        };
        int opt;