diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2012-06-18 22:30:29 +0930 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2012-06-19 05:38:06 +0200 |
commit | 9396757676c304398a3e94ad01f2657e667b113c (patch) | |
tree | ca55222ca49c2d886f8717be73f3c403ed1a37c2 /lib/ntdb/private.h | |
parent | dd4eed47591eeb6aafe5782690c1b550d0e3ebc4 (diff) | |
download | samba-9396757676c304398a3e94ad01f2657e667b113c.tar.gz samba-9396757676c304398a3e94ad01f2657e667b113c.tar.bz2 samba-9396757676c304398a3e94ad01f2657e667b113c.zip |
ntdb: make sure file is always a multiple of PAGESIZE (now NTDB_PGSIZE)
ntdb uses tdb's transaction code, and it has an undocumented but implicit
assumption: that the transaction recovery area is always aligned to the
transaction pagesize. This means that no block will overlap the recovery
area.
This is maintained by rounding the size of the database up, so do the same
for ntdb.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'lib/ntdb/private.h')
-rw-r--r-- | lib/ntdb/private.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/ntdb/private.h b/lib/ntdb/private.h index e1c2fdafc4..4e87f15b8f 100644 --- a/lib/ntdb/private.h +++ b/lib/ntdb/private.h @@ -98,6 +98,10 @@ typedef uint64_t ntdb_off_t; #define NTDB_PTR_ERR(p) ((enum NTDB_ERROR)(long)(p)) #define NTDB_ERR_PTR(err) ((void *)(long)(err)) +/* This doesn't really need to be pagesize, but we use it for similar + * reasons. */ +#define NTDB_PGSIZE 65536 + /* Common case of returning true, false or -ve error. */ typedef int ntdb_bool_err; |