tdb: include information about hash function being used in tdbtool info output
authorChristian Ambach <ambi@samba.org>
Fri, 10 May 2013 22:45:15 +0000 (00:45 +0200)
committerChristian Ambach <ambi@samba.org>
Tue, 14 May 2013 12:34:20 +0000 (14:34 +0200)
makes it possible to easily determine if the tdb under examination
uses jenkins hash or not

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
lib/tdb/common/summary.c

index f4e6d2c7b4e01c0e7ee64a42ae9fdeb1e4fb1142..ef2c49a2dae57771284ac3b217ca46de84ebc43c 100644 (file)
@@ -20,6 +20,7 @@
 #define SUMMARY_FORMAT \
        "Size of file/data: %u/%zu\n" \
        "Number of records: %zu\n" \
+       "Incompatible hash: %s\n" \
        "Smallest/average/largest keys: %zu/%zu/%zu\n" \
        "Smallest/average/largest data: %zu/%zu/%zu\n" \
        "Smallest/average/largest padding: %zu/%zu/%zu\n" \
@@ -171,6 +172,7 @@ _PUBLIC_ char *tdb_summary(struct tdb_context *tdb)
        snprintf(ret, len, SUMMARY_FORMAT,
                 tdb->map_size, keys.total+data.total,
                 keys.num,
+                (tdb->hash_fn == tdb_jenkins_hash)?"yes":"no",
                 keys.min, tally_mean(&keys), keys.max,
                 data.min, tally_mean(&data), data.max,
                 extra.min, tally_mean(&extra), extra.max,