Age | Commit message (Collapse) | Author | Files | Lines |
|
Like tdb1, it's the caller's responsibility to set up various config
options (eg. by #include "config.h") before including the public
header.
We use HAVE_CCAN for including the (private) CCAN headers, otherwise
dummy macros are used.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
This will be used shortly to indicate that a TDB2 file indicates it
cannot be checked.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit e01d795c8964b791def1e9f68c386b350b3a2a84)
|
|
This is what lib/tdb2 really wants: to know if it should use normal
headers or replace.h. It currently uses _SAMBA_BUILD_, which is wrong
for ldb, for example.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-User: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date: Tue Nov 1 03:19:58 CET 2011 on sn-devel-104
|
|
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)
|
|
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit a4f2eb983b92b68bcad2a0d640924b8b456e3d69)
|
|
Move the tdb1_repack() code into the core, make it general, rename to
tdb_repack().
It's generic code: copy database into temporary, wipe it, copy back.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit e487983a4099b6f760056ff7182f2ff543e6da71)
|
|
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)
|
|
This will be set for old TDBs; we can start distinguishing paths based
on it now.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 2b50be90a23893a06e0f1436a31d18b97ad0e11d)
|
|
Create an iterator over every open tdb (not internal TDBs). This is
useful for re-establishing the tdb1-style active lock for
CLEAR_IF_FIRST.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 1a0c636bc38213bd0322db47529f78f2dc22ffdd)
|
|
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)
|
|
You can only unset it if the TDB was originally opened O_RDWR.
Also, cleaned up error handling in tdb_allrecord_lock() so we only get
one log message on a r/o database.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit b87e14495d5b07e1b247218a72329f10ecb3da7f)
|
|
Since we've deprecated tdb_error() function (and it didn't work right
from inside the logging function anyway, since we didn't set
tdb->ecode yet) we need to hand it to the log function.
(Imported from CCAN commit 6e3d9e8a66bf8b45150500f176452ee8e9ee9927)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
We use off_t in the tdb2 interface (for tdb_attribute_flock); we need
to make sure that all callers agree on the size.
This also causes a problem in the tests: it's not enough to include
config.h first, we need the _FILE_OFFSET_BITS define from private.h.
Otherwise, we can disagree about the definitions of F_SETLK, F_SETLKW
and off_t, causing strange problems.
(Imported from CCAN commit baa17ee2d5e01a32030f19e566007417d72b4b6e)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
This is a bit messy, but it works. Kept as a separate patch so it's
easier to merge back and forth with CCAN's tdb2.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|