summaryrefslogtreecommitdiff
path: root/source4/lib/tdb/common
AgeCommit message (Collapse)AuthorFilesLines
2007-10-10r17532: merge from SAMBA_3_0 Revision: 17460Stefan Metzmacher1-0/+1
First step at fixing the build breakage with the groupmapping test. On Linux, F_RDLCK is defined to 0, for example NetBSD has it at 1. Still does not work fully though. Still investigating. metze (This used to be commit af08e56442367b5d803f61b8554d85e2fe0ce7e9)
2007-10-10r17507: pread and pwrite depends on HAVE_PREAD/HAVE_PWRITE not ↵Simo Sorce1-7/+0
HAVE_PREAD_DECL/HAVE_PWRITE_DECL and common/io.h already defines pread and pwrite as static if they are not. remove unneded defines (This used to be commit 941f680453a081d51f6499f9b5dc06c7e6640334)
2007-10-10r16916: Implement metze's proposed changes to the tdb logging API.Andrew Bartlett3-13/+16
This clearly links the log function with its private pointer, and makes the argument list for tdb_open_ex a bit shorter. Andrew Bartlett (This used to be commit 5d5503e8d8a10ead3ef21a5ffda52cadb9a07727)
2007-10-10r16776: fix typoStefan Metzmacher1-1/+1
metze (This used to be commit 249bf24a40f78aab181a4cce8c42902859e43238)
2007-10-10r16774: This patch modifies the tdb API to allow the logging function to be usedAndrew Bartlett8-108/+116
as part of ldb. This allows tdb failures to be passed all the way up to Samba's DEBUG system, which allowed easier debugging. Unfortunately I had to extend the tdb API, as the logging function didn't have a context pointer. I've worked over the 'debug levels' in TDB. Most of them were 0, which didn't seem right, as some were trace-like messages. We didn't see any of these previously, except when accessing TDB directly. Andrew Bartlett (This used to be commit 58898092c1ce043f6d698db5065f372b79109e22)
2007-10-10r16043: Fix error messageSimo Sorce1-3/+3
(This used to be commit 2898df2cee22f2d478440e9576bec15140909e45)
2007-10-10r15120: Minimize the diff between Samba3 and Samba4 tdb: In Samba3 we don't ↵Volker Lendecke1-7/+7
allow C++ keywords. Change "private" -> "private_data". Volker (This used to be commit 047671567173e808fece41485bbeaaeebab7d4a2)
2007-10-10r15100: Port the bugfix for #3569 to Samba4Volker Lendecke1-1/+17
(This used to be commit 5f1d52f232051324082b840f29dd7719a9328bd5)
2007-10-10r14972: fix an uninitialised warning from ibm checkerAndrew Tridgell1-1/+1
(This used to be commit 9b867d2acffdfdcd5dc1dd5341db19daf11b5e96)
2007-10-10r14916: print errno so I can work out why OpenBSD is failing the test for tdbAndrew Tridgell1-1/+2
in the build farm. msync() is failing. (This used to be commit 4c3f3c414135c2b8fa9ea11a156246b56285b84f)
2007-10-10r14799: added a tdb_get_seqnum() call, and the TDB_SEQNUM flag. This allowsAndrew Tridgell3-1/+63
for an extremely lightweight test to see if a tdb has possibly changed. (This used to be commit f325ba605ccceca63712c0f2c98961e35e437b3d)
2007-10-10r14029: Fix resource leak in error codepath. Coverity CID #64.Jeremy Allison1-2/+6
Jeremy. (This used to be commit d2e9d5b34baee90060ee9131b3da903309625a56)
2007-10-10r13773: Be consistent in the way you get out and free allocated dataSimo Sorce1-2/+2
(This used to be commit 1113d4caa7bea1a7ffb9a50f42c5672bc1d452b4)
2007-10-10r13283: added two optimisations to the tdb transactions code. The first is toAndrew Tridgell1-1/+36
more agressively coalesce entries in the linked list of the undo log. The second is to ensure that writes during a transaction into the hash table don't cause the size of the undo log linked list to grow. These optimisations don't affect Samba much, but they make a huge difference to the use of ldb in kde (This used to be commit a37d9434d1fa181fd3d060ad032ee4ec5135fc52)
2007-10-10r10891: I noticed that the secrets.db was not being backed up on my system dueAndrew Tridgell1-0/+9
to msync/mmap not changing the mtime of the file. This patch ensures that for successfully completed transactions we update the mtime. I don't do this on all tdb writes as its too expensive, but doing it just on transactions is bearable, as those cost quite a lot anyway. (This used to be commit b2934732dd62f705f59c124f19460c5436a9a422)
2007-10-10r10524: SAFE_FREE() in tdb does not need the discard_const_p()Andrew Tridgell1-10/+1
the discard_const_p() was causing problems on openbsd where intptr_t is not defined (This used to be commit f02a92787b179a4070227d87e37b7ac092d9e6eb)
2007-10-10r10522: finally got the locking working on solaris10. This adds a read lock onAndrew Tridgell1-0/+12
the transaction lock in tdb_traverse_read(). This prevents a pattern of locks which triggers the deadlock detection code in solaris10. I suspect solaris10 is trying to prevent lock starvation by granting locks in the order they were requested, which makes it much easier to produce deadlocks. (This used to be commit 54203aacd138c30826d54c5d9b6cc8d6e9e270f8)
2007-10-10r10496: - added configure test for sys/time.hAndrew Tridgell1-2/+2
- print length of failed locks (This used to be commit 11739ad31d7b3e1cf94ebf395608647e341257c4)
2007-10-10r10495: older redhat boxes need sys/time.h for select()Andrew Tridgell1-0/+3
(This used to be commit a11762e7bc139b0280e457e682722d955b81d8e5)
2007-10-10r10494: - don't generate a tdb log message for any type of failed lock probeAndrew Tridgell1-5/+2
- if the lock upgrade loop ever fails then log a warning (This used to be commit 1b03c4e6c7e89452a835ef5ff39c07f58b715a22)
2007-10-10r10493: we need sys/select.h to enable select() in the solaris workaroundAndrew Tridgell1-0/+3
(This used to be commit 144cc3da5eadf0dcb28ef722feeed813c033e08a)
2007-10-10r10492: work around a bug in solaris which cases lock upgrades to fail withAndrew Tridgell3-1/+28
EDEADLK even when progress can be made. This is not a good solution, but I can't find anything better. (This used to be commit 980dd17f7d0a622cd772afc9ba15e50007ad9c6e)
2007-10-10r10484: try to fix the pread/pwrite declaration problemsAndrew Tridgell1-7/+1
(This used to be commit 196995ea38414ce5a57031c4cdf61b3ed548196a)
2007-10-10r10483: fixed some uninitialised variables warningsAndrew Tridgell2-1/+3
(This used to be commit 315653cf1ecc11c435ee35b20e6cf9c73a67fa68)
2007-10-10r10471: stratos doesn't have getpagesize(), so guess 8k on systems that don'tAndrew Tridgell1-0/+4
have it. Overestimating is harmless. (This used to be commit ab953c8c72060c496876b6f39d388ad2f7e3c7e0)
2007-10-10r10469: use the older style of structure initialisation for tdb to make itAndrew Tridgell2-12/+12
more portable. tdb is used in more than just Samba4, and I think the portability/readability balance is a bit different (This used to be commit fc692dc61f06d61cb9126d2a8ccc240cecd11da6)
2007-10-10r10468: - terminate tdbtorture quickly when an error is detectedAndrew Tridgell2-0/+8
- more workarounds for aix not handling malloc of size 0 (This used to be commit c2b1739c6389503854f55fa8407c55071781eff4)
2007-10-10r10467: aix doesn't like zero length malloc :(Andrew Tridgell1-0/+5
(This used to be commit 0177c6ca3e9baa223b5f7b29adc12d862dcb19d8)
2007-10-10r10466: work around missing pread/pwrite declaration on openbsdAndrew Tridgell1-0/+8
(This used to be commit e615f36733966f9992670e3650fbe9b20d7d218c)
2007-10-10r10465: separate out a read_only db from a read-only traversal to ensure weAndrew Tridgell6-12/+13
don't end up doing a mmap read only (This used to be commit 294ccfd46a0c4e1af9365d028acdabec03c41ad3)
2007-10-10r10461: fixed tdb build on systems without stdint.hAndrew Tridgell1-2/+2
(This used to be commit 83168c7e76c7e3adcdb0eec1611827d4db09f858)
2007-10-10r10460: fixed portability of transaction code to systems with integerAndrew Tridgell1-6/+7
alignment constraints (like sparc) (This used to be commit bce35ad237a55376b6af98416eec92a7c4b422a6)
2007-10-10r10459: fixed some portability problemsAndrew Tridgell1-0/+2
(This used to be commit 03942dd54b31e7a4cf9c6270b26ccf68a3234b40)
2007-10-10r10424: for caller convenience, automatically turn a tdb_traverse() into aAndrew Tridgell1-0/+4
tdb_traverse_read() for read only databases (This used to be commit 9b53e04377d2ff652c4a9496798d2e3aa0dccab3)
2007-10-10r10421: following on discussions with simo, I have worked out a way ofAndrew Tridgell7-29/+100
allowing searches to proceed while another process is in a transaction, then only upgrading the transaction lock to a write lock on commit. The solution is: - split tdb_traverse() into two calls, called tdb_traverse() and tdb_traverse_read(). The _read() version only gets read locks, and will fail any write operations made in the callback from the traverse. - the normal tdb_traverse() call allows for read or write operations in the callback, but gets the transaction lock, preventing transastions from starting inside the traverse In addition we enforce the following rule that you may not start a transaction within a traverse callback, although you can start a traverse within a transaction With these rules in place I believe all the deadlock possibilities are removed, and we can now allow for searches to happen in parallel with transactions (This used to be commit 7dd31288a701d772e45b1960ac4ce4cc1be782ed)
2007-10-10r10405: added transactions into tdb, and hook them into ldb. See myAndrew Tridgell10-66/+1138
samba-technical posting for more details on the transactions design. This also adds a number of command line arguments to tdbtorture, making it more flexible, and fixes some lock deadlock conditions in the tdbtorture code. (This used to be commit 06bd8abba942ec9f1e23f5c5d546cbb71ca3a701)
2007-10-10r10258: Fix an unused/duplicate local variable.Tim Potter1-2/+0
(This used to be commit 360be7028c2244391cdd9ed6d156cec8dab9e9e9)
2007-10-10r10253: a fairly large tdb cleanup and re-organise. Nearly all of this changeAndrew Tridgell11-2395/+2128
just involves splitting up the core tdb.c code into separate files on logical boundaries, but there are some minor functional changes as well: - move the 'struct tdb_context' into tdb_private.h, hiding it from users. This was done to allow the structure to change without breaking code that uses tdb. - added accessor functions tdb_fd(), tdb_name(), and tdb_log_fn() to access the elements of struct tdb_context that were used by external code but are no longer visible - simplied tdb_append() to use tdb_fetch()/tdb_store(), which is just as good due to the way tdb locks work - changed some of the types (such as tdb_off to tdb_off_t) to make syntax highlighting work better - removed the old optional spinlock code. It was a bad idea. - fixed a bug in tdb_reopen_all() that caused tdbtorture to sometimes fail or report nasty looking errors. This is the only real bug fixed in this commit. Jeremy/Jerry, you might like to pickup this change for Samba3, as that could definately affect smbd in Samba3. The aim of all of these changes is to make the tdb transactions/journaling code I am working on easier to write. I started to write it on top of the existing tdb.c code and it got very messy. Splitting up the code makes it much easier to follow. There are more cleanups we could do in tdb, such as using uint32_t instead of u32 (suggested by metze). I'll leave those for another day. (This used to be commit 4673cdd0d261614e707b72a7a348bb0e7dbb2482)
2007-10-10r9774: r11605@blu: tridge | 2005-08-30 12:02:19 +1000Andrew Tridgell1-0/+3
make sure we don't walk off the end of the hash array (This used to be commit 3c32f24e2c6a99ec294fb16e1684cd22b08f2df4)
2007-10-10r9773: r11599@blu: tridge | 2005-08-30 11:55:57 +1000Andrew Tridgell1-5/+13
optimise this case a bit more. The total speedup using non-indexed ldbtest is now around a factor of 80x. The code is ugly as hell, but I think this speed is worth it. Of course, if we only ever do indexed searches in ldb then this doesn't help, but it seems all too common that we get unindexable searches, so the optimisation is worthwhile (This used to be commit 2e14fb893dd9815cdb2488c630131dc549e5c361)
2007-10-10r9769: r11592@blu: tridge | 2005-08-30 10:40:19 +1000Andrew Tridgell1-0/+37
added a tdb optimisation that speeds up non-indexed ldb by a large margin (often 10x or more). I'd be interested in any comments on the safety of this optimisation. See the comment in the code for an explanation. (This used to be commit 7f9efaceb6d6dfc0c82923344cc45ec34493f2ed)
2007-10-10r8624: removed valgrind comment on tdb that no longer appliesAndrew Tridgell1-19/+0
(This used to be commit 8f222c8c7a750c739d3288da0b1edb1efc3b1ffc)
2007-10-10r7641: Fix based on work from "Shlomi Yaakobovich" <Shlomi@exanet.com> to catchJeremy Allison1-6/+7
loops in corrupted tdb files. Jeremy. (This used to be commit f9f3037d6855259edd56fd5a23d63dbb37f0a751)
2007-10-10r7276: - moved static tdb function ltdb_dn_fold() into common/ so that it can beDerrell Lipman1-1/+10
called from multiple backends. (ldb_sqlite3 needs it too.) Added parameter for a callback function that determines whether an attribute needs case folding. - begin to prepare for sqlite3 in build process - work-in-progress updates, on ldb_sqlite3 (This used to be commit a80bced0b96ffb655559a43cf7f4d7a34deb5a7d)
2007-10-10r6528: - in tdb_fetch() we effectively disallowed zero length records byAndrew Tridgell1-7/+4
returning NULL/0, which is the same as we used for a failure. Having to look at tdb->ecode (which we never do) is too error prone. Instead, tdb_fetch() should behave like malloc() and talloc(), where zero length is not special and malloc(0) returns a valid pointer. - similarly in data_blob(), asking for data_blob(NULL, 0) should return a zero blob, but asking for data_blob(ptr, 0) should return a zero length blob with a valid pointer, just like talloc() and malloc() This change fixes the SummaryInformation stream stored in the tdb backend when manipulated from w2k. The w2k client was using SET_EOF_INFORMATION to create a zero-length stream, which we return STATUS_NOT_FOUND on, as the tdb_fetch() gave us back a NULL/0 blob, which we returned as not-found (This used to be commit 162bbe4402b9de6ac06103df904b9fc204fbff29)
2007-10-10r6238: Ensure if realloc fails on an internalJeremy Allison1-3/+8
tdb we fail gracefully. Jeremy. (This used to be commit d69f7c05468ae54e0474b188fedabe14e7297d53)
2007-10-10r5780: Remove unused arguments.Tim Potter1-6/+6
(This used to be commit 1ee84e373e2b44c96f9353f194b766d6a144e7ce)
2007-10-10r5779: Remove signal and timeout gubbage from tdb.Tim Potter2-126/+4
(This used to be commit dbb56e9a59cf00d57b09ded6d60bf9424d5f1f4c)
2007-10-10r5533: Patch to detect infinite loops when traversing a tdb from "Shlomi ↵Jeremy Allison1-0/+7
Yaakobovich" <Shlomi@exanet.com> Jeremy. (This used to be commit 84f6d2b3dd29c1aa478708db9617a79382158f64)
2007-10-10r5298: - got rid of pstring.h from includes.h. This at least makes it a bitAndrew Tridgell2-0/+3
less likely that anyone will use pstring for new code - got rid of winbind_client.h from includes.h. This one triggered a huge change, as winbind_client.h was including system/filesys.h and defining the old uint32 and uint16 types, as well as its own pstring and fstring. (This used to be commit 9db6c79e902ec538108d6b7d3324039aabe1704f)