- 27 Apr, 2011 2 commits
-
-
Rusty Russell authored
It's probably not a good idea, because it's a recipe for deadlocks if anyone else grabs any *other* two chainlocks, or the allrecord lock, but SAMBA definitely does it, so allow it as TDB1 does.
-
Rusty Russell authored
Now we have tdb_get_attribute, it makes sense to make that the method of accessing statistics. That way they are always available, and it's probably cheaper doing the direct increment than even the unlikely() branch.
-
- 07 Apr, 2011 4 commits
-
-
Rusty Russell authored
Otherwise tdb_name() can be NULL in log functions. And we might as well allocate it with the tdb, as well.
-
Rusty Russell authored
-
Rusty Russell authored
It makes sense for some attributes to be manipulated after tdb_open, so allow that.
-
Rusty Russell authored
This allows overriding of low-level locking functions. This allows special effects such as non-blocking operations, and lock proxying. We rename some local lock vars to l to avoid -Wshadow warnings.
-
- 06 Apr, 2011 1 commit
-
-
Rusty Russell authored
And don't double-log. Both of these cause problems if we want to do tdb_transaction_prepare_commit non-blocking (and have it fail so we can try again).
-
- 07 Apr, 2011 1 commit
-
-
Rusty Russell authored
This allows the caller to implement clear-if-first semantics as per TDB1. The flag was removed for good reasons: performance and unreliability, but SAMBA3 still uses it widely, so this allows them to reimplement it themselves. (There is no way to do it without help like this from tdb2, since it has to be done under the open lock).
-
- 10 May, 2011 1 commit
-
-
Rusty Russell authored
1) The logging function needs to append a \n. 2) The transaction start code should be after the comment and print. 3) We should run tdb_check to make sure the database is OK after each op.
-
- 07 Apr, 2011 3 commits
-
-
Rusty Russell authored
Also, rename private logfn to log_fn for consistency with other members.
-
Rusty Russell authored
We use underscores everywhere else, so be consistent.
-
Rusty Russell authored
It's redundant calling hash.hash_fn for example. Standardize on fn and data as names (private conflicts with C++).
-
- 29 Mar, 2011 2 commits
-
-
Rusty Russell authored
This gives us more locks for future use, plus allows a clear-if-first-style hack to be implemented.
-
Rusty Russell authored
-
- 19 Apr, 2011 1 commit
-
-
Rusty Russell authored
1) Fix the bogus reporting of uncoalesced runs: there has to be more than 1 free record to make a "run", and any other record interrups the run. 2) Fix the bogus data count in the top line (which was number of records, not bytes). 3) Remove the count of free buckets: it's now a constant.
-
- 28 Apr, 2011 4 commits
-
-
Rusty Russell authored
Douglas Bagnell noted that it didn't specify.
-
Rusty Russell authored
It's common when integrating CCAN into existing projects that they define such constants for themselves. In an ideal world, the entire project switches to one set of definitions, but for large projects (eg SAMBA) that's not realistic and conflicts with the aim of making CCAN modules easy to "drop in" to existing code. (This is a generalization of Douglas Bagnell's patch sent in Message-ID: <4DB8D00D.8000800@paradise.net.nz>).
-
Douglas Bagnall authored
Makes it easier to reuse this code in other projects.
-
Douglas Bagnall authored
-
- 27 Apr, 2011 5 commits
-
-
Rusty Russell authored
It's useful for developers, but not so much for casual users. For example, RHEL 5.6 has qsort_r, but no prototype, which causes a warning.
-
Rusty Russell authored
Otherwise, _GNU_SOURCE isn't defined (for example) so prototypes such as isblank can be missing.
-
Rusty Russell authored
-
Andreas Schlick authored
If the line is made solely of whitespaces, they get removed and we end up with len set to -1. Therefore we need an additional check to avoid dereferencing line[-1].
-
Andreas Schlick authored
-
- 19 Apr, 2011 2 commits
-
-
Rusty Russell authored
Inspired by patch from Volker.
-
Rusty Russell authored
-
- 06 Apr, 2011 1 commit
-
-
Rusty Russell authored
Get rid of many variants, which were just confusing for most people. Keep typesafe_cb(), typesafe_cb_preargs() and typesafe_cb_postarts(), and rework cast_if_type() into typesafe_cb_cast() so we stay in our namespace. I should have done this as soon as I discovered the limitation that the types have to be defined if I want const-taking callbacks.
-
- 19 Apr, 2011 3 commits
-
-
Rusty Russell authored
Don't check the whole source, but it's nice for headers to be C++-clean.
-
Rusty Russell authored
Defines whether it's useful to do #define _FILE_OFFSET_BITS 64 to get a larger off_t.
-
Rusty Russell authored
-
- 02 Apr, 2011 8 commits
-
-
Andreas Schlick authored
-
Andreas Schlick authored
Most Linux systems use glibc and therefore have qsort_r() and for the others an implementation is provided, therefore there is no need to have a third case in asort.
-
Andreas Schlick authored
This avoids a warning on systems that have a 16bit wide mode_t.
-
Rusty Russell authored
Leave old hacky #ifdef tests there for reference.
-
Andreas Schlick authored
-
Andreas Schlick authored
-
Andreas Schlick authored
tools/ccanlint/file_analysis.c needs to include config.h to set _GNU_SOURCE before any other header file includes stdlib.h.
-
Andreas Schlick authored
-
- 28 Mar, 2011 2 commits
-
-
Rusty Russell authored
-
Rusty Russell authored
-