ntdb: create initial database to be multiple of NTDB_PGSIZE.
commitdb2508840d55842ebaf0c0d7a2fa3c855498e75f
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 18 Jun 2012 13:00:29 +0000 (18 22:30 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 19 Jun 2012 03:38:06 +0000 (19 05:38 +0200)
tree6123390e0616ed98eb173422e94e8c5c0e862459
parent9396757676c304398a3e94ad01f2657e667b113c
ntdb: create initial database to be multiple of NTDB_PGSIZE.

As copied from tdb1, there is logic in the transaction code to handle
a non-PGSIZE multiple db, but in fact this only happens for a
completely unused database: as soon as we add anything to it, it is
expanded to a NTDB_PGSIZE multiple.

If we create the database with a free record which pads it out to
NTDB_PGSIZE, we can remove this last-page-is-different logic.

Of course, the fake ntdbs we create in our tests now also need to be
multiples of NTDB_PGSIZE, so we change some numbers there too.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
lib/ntdb/open.c
lib/ntdb/test/api-91-get-stats.c
lib/ntdb/test/failtest_helper.h
lib/ntdb/test/run-03-coalesce.c
lib/ntdb/test/run-30-exhaust-before-expand.c
lib/ntdb/test/run-64-bit-tdb.c
lib/ntdb/test/run-capabilities.c
lib/ntdb/test/run-expand-in-transaction.c