1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-12 20:58:37 +03:00

r9095: Add crude chainlength statistics to the crude tdbtool.

Volker
This commit is contained in:
Volker Lendecke 2005-08-05 04:32:24 +00:00 committed by Gerald (Jerry) Carter
parent 65adbd83fe
commit 5e6fef32b3

View File

@ -560,6 +560,7 @@ static tdb_off tdb_dump_record(TDB_CONTEXT *tdb, tdb_off offset)
static int tdb_dump_chain(TDB_CONTEXT *tdb, int i)
{
tdb_off rec_ptr, top;
int hash_length = 0;
top = TDB_HASH_TOP(i);
@ -574,8 +575,11 @@ static int tdb_dump_chain(TDB_CONTEXT *tdb, int i)
while (rec_ptr) {
rec_ptr = tdb_dump_record(tdb, rec_ptr);
hash_length += 1;
}
printf("chain %d length %d\n", i, hash_length);
return tdb_unlock(tdb, i, F_WRLCK);
}