Age | Commit message (Collapse) | Author | Files | Lines |
|
This allows even more extensibility in future: in particular, the top
bits of each capability tell us what to do if we don't understand it:
fail the open, fail to open for write, or don't try to check the
format.
tdb_check needs to understand the capability list so it can know to
skip over it: each element in the list is prefixed with the type tag
and the length.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 35f198de1851a7d57064546b7ced677b6fabee27)
|
|
This avoids a silly realloc, but more importantly it gets us closer to
being runtime extensible, as each history element can be a different
size.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 9571a41e8494f3135557e3ec50c2de856392173e)
|
|
Less cut & paste means less patching as failtest changes.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 1819a36a3e69565bd7b853503fceb846558a45bd)
|
|
This allows us to simulate the old "volatile" flag for tdb1. It's not
necessary for tdb2.
As this is the last function in tdb1.h, we remove that file.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit b8e64e9346793164651a36eccb3c205077e5c91b)
|
|
Finally, we gut tdb1_open() to the tdb1-specific parts, and call it
from tdb_open if they specify the TDB_VERSION1 flag or the version is
a TDB1.
We also unify tdb_close(), based on the TDB_VERSION1 flag.
Note that tdb_open(TDB_VERSION1) will fail on an existing tdb if it's
a TDB2.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit c8c3b3568677e8b0105f84e4ab068c580faf4591)
|
|
It also only makes sense with O_CREAT.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit fc44729c471bcdc7ab0410448d991a65e74cec3d)
|
|
This replaces the tdb1_open "hash_size" argument. It will only be
valid when you call tdb_open() with O_CREAT in open_flags, and
TDB_VERSION1 in tdb_flags.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 49475d68deecd0b31597ed6094229171d2699b11)
|
|
We're going to need access to it from tdb1_open, so expose it now.
It's better in hash.c anyway.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit c8f6f8c2dea76042f74c02eff048847e62adcca6)
|
|
This makes it easy to call it again after a fork(), such as for
re-establishing the CLEAR_IF_FIRST files locks.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 937d0babe99dcd315040a9e48430140e63e4a7df)
|
|
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|