diff options
Diffstat (limited to 'lib/tdb2/transaction.c')
-rw-r--r-- | lib/tdb2/transaction.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/tdb2/transaction.c b/lib/tdb2/transaction.c index 70e664fc2d..dd94510c02 100644 --- a/lib/tdb2/transaction.c +++ b/lib/tdb2/transaction.c @@ -836,10 +836,13 @@ static tdb_off_t create_recovery_area(struct tdb_context *tdb, /* round up to a multiple of page size. Overallocate, since each * such allocation forces us to expand the file. */ - rec->max_len - = (((sizeof(*rec) + rec_length + rec_length / 2) - + PAGESIZE-1) & ~(PAGESIZE-1)) + rec->max_len = tdb_expand_adjust(tdb->file->map_size, rec_length); + + /* Round up to a page. */ + rec->max_len = ((sizeof(*rec) + rec->max_len + PAGESIZE-1) + & ~(PAGESIZE-1)) - sizeof(*rec); + off = tdb->file->map_size; /* Restore ->map_size before calling underlying expand_file. |