Age | Commit message (Collapse) | Author | Files | Lines |
|
This patch adds two lock functions used by CTDB to perform asynchronous
locking. These functions do not actually perform any fcntl operations,
but only increment internal counters.
- tdb_transaction_write_lock_mark()
- tdb_transaction_write_lock_unmark()
It also exposes two internal functions
- tdb_lock_nonblock()
- tdb_unlock()
These functions are NOT exposed in include/tdb.h to prevent any further
uses of these functions. If you ever need to use these functions, consider
using tdb2.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
|
|
cast_const() et. al. are supposed to be a constant expression, so you can do things like:
static char *p = cast_const(char *, (const char *)"hello");
Unfortunately, a cast to intptr_t and arithmetic makes suncc reject it as
a constant expression. We need the cast, because (1) the expression could be
a void *, so we can't just add to it, and (2) gcc complains with -Wcast-qual
without it.
So instead of adding BUILD_BUG_OR_ZERO, we use a ? :, which keeps everyone happy.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 74859ab18b10aaf990848e49d7789ff5c6cf96c6)
Autobuild-User: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date: Thu Mar 29 08:18:57 CEST 2012 on sn-devel-104
|
|
It still gave a warning on gcc, because casting a char to a char* gives a warning. Not so on sun CC.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 6569a707d169a629e25e10710c760c8dc84525c7)
|
|
We were handing an int-returning function where we should hand an enum TDB_ERROR
returning function. Worse, it was returning 0/-1 instead of 0/TDB_ERR_*.
Fortunately, it's only compared against success, but the Solaris compiler
warns about it, and it's not correct anyway.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
|
|
Achieve this by introducing a "disallowDNFilter" flag.
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
|
|
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sun Mar 25 00:13:59 CET 2012 on sn-devel-104
|
|
|
|
The performance of these is minimal (these days) and they can return
invalid results when used as part of applications that do not use
sys_fork().
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Mar 24 21:55:41 CET 2012 on sn-devel-104
|
|
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Mar 24 18:50:32 CET 2012 on sn-devel-104
|
|
It's fine to ignore socket wrapper here, as it doesn't deal with unix domain sockets.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This way it will also work with pipes
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Fri Mar 23 17:31:24 CET 2012 on sn-devel-104
|
|
We unmap the tdb on expand, the remap. But when we have INCOHERENT_MMAP
(ie. OpenBSD) and we're inside a transaction, doing the expand can mean
we need to read from the database to partially fill a transaction block.
This fails, because if mmap is incoherent we never allow accessing the
database via read/write.
The solution is not to unmap and remap until we've actually written the
padding at the end of the file.
Reported-by: Amitay Isaacs <amitay@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-User: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date: Fri Mar 23 02:53:15 CET 2012 on sn-devel-104
|
|
Since we force mmap on, we don't intercept writes to the db, so we never
see it in an inconsistent state. #ifdef over the check that we should have
recovered it at least once.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
fde694274e1e5a11d1473695e7ec7a97f95d39e4 made tdb_mmap return an int,
but didn't put the return 0 on the "internal db" case.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
We use tdb_mkdata() to get rid of many of them from the tests, and
explicit cast_const() in a few places.
tlist_for_each() still causes a warning, but that needs to be fixed in
CCAN.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-User: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date: Thu Mar 22 03:29:32 CET 2012 on sn-devel-104
|
|
These warnings clutter things up, even though they're of marginal
utility.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
This handles incoherent mmaps for TDB2 native databases, by forcing
mmap on for such systems, just like we did for tdb1.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
This is a direct port of the previous patch, to the TDB2 codebase.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
This comment appears in two places in the code (commit
4c6a8273c6dd3e2aeda5a63c4a62aa55bc133099 from 2001):
/*
* We must ensure the file is unmapped before doing this
* to ensure consistency with systems like OpenBSD where
* writes and mmaps are not consistent.
*/
But this doesn't help, because if one process is using mmap and another
using pwrite, we get incoherent results. As demonstrated by OpenBSD's
failure on the tdb unit tests.
Rather than disable mmap on OpenBSD, we test for this issue and force mmap
to be enabled. This means that we will fail on very large TDBs on 32-bit
systems, but it's better than the horrendous performance penalty on every
OpenBSD system.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
We test for other mmap features here, and both tdb1 and tdb2 want this check.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
OpenBSD doesn't idempotent-wrap sys/mman.h, so when we #define mmap to
an alternative, it fails to compile when sys/mman.h is included again.
Workaround is not to #define mmap to add arguments on Open BSD.
(Imported from CCAN commit e18e80fe175422d26efe689addc0f67bdba0e097)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
CCAN includes a little utility called "namespacize" which prepends ccan_ to
all public methods of a module, and fixes up any dependencies it finds. It's
a little primitive, but it works here.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
By using a different include order, we end up with a different version of
FILE_OFFSET_BITS (and probably other things) in parts of the test. The
different variants get linked together, and the result is weird: the stat
returns 0 size.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
Do not use -Wl,-no-undefined flag on OpenBSD 5.x (tested on 5.0)
Autobuild-User: Amitay Isaacs <amitay@samba.org>
Autobuild-Date: Fri Mar 16 05:14:03 CET 2012 on sn-devel-104
|
|
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Fri Mar 16 02:48:52 CET 2012 on sn-devel-104
|
|
On some platforms you can not debug coredumps after the default signal handler
gets done dumping core. This allows waf to have an option to disable our
default signal handler.
|
|
|
|
metze
|
|
metze
|
|
metze
|
|
metze
|
|
metze
|
|
This confused the subunit code.
metze
|
|
These were relics: they don't need to be defined here as long as we are
careful to include the replace headers before any standard headers (we are).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-User: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date: Wed Mar 14 10:12:26 CET 2012 on sn-devel-104
|
|
This was a relic from testing; it can interfere with compile.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
CommonCrypto/CommonDigest is available on Mac and there is function in
the libc for MD5 calculation. MD5Final is a C define of CC_MD5_Final.
Under some circumstance we have the symbol defined twice in samba
binaries on Snow Leopard at least.
By detecting CommonCrypto/CommonDigest we end up always using the system
version if available.
|
|
Another PPC issue (endian?) revealed that the summary code did not handle
capabilities correctly: in fact, it went into an endless loop.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-User: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date: Wed Mar 14 06:51:43 CET 2012 on sn-devel-104
|
|
This caused a crash on PPC64 when we failed the mmap (found by failtest,
reported by Amitay)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|