projects
/
ccan
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tdb2: copy tdb1's changed expansion logic.
[ccan]
/
ccan
/
tdb2
/
transaction.c
diff --git
a/ccan/tdb2/transaction.c
b/ccan/tdb2/transaction.c
index 70e664fc2d60e5fe36bda442607fbdfba04677ff..dd94510c027343d1c6aac0e6ec0d6e3d28ffeaab 100644
(file)
--- a/
ccan/tdb2/transaction.c
+++ b/
ccan/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. */
/* 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);
- sizeof(*rec);
+
off = tdb->file->map_size;
/* Restore ->map_size before calling underlying expand_file.
off = tdb->file->map_size;
/* Restore ->map_size before calling underlying expand_file.