summaryrefslogtreecommitdiff
path: root/source4/lib/tdb/common/tdb_private.h
AgeCommit message (Collapse)AuthorFilesLines
2007-10-10r19401: make tdb_lockall() much more efficient, and add a tdb_lockall_read()Andrew Tridgell1-4/+3
call which does a read lock on all chains. These will be used to make ldb searches more efficient (This used to be commit de664ec1f8cf179f1d650563272c0de3f7636e2b)
2007-10-10r18400: move MAP_FAILED define to lib/replace/system/shmem.hAndrew Tridgell1-4/+0
(This used to be commit 025b142ff268498cfb36fc0e7e9e25a2c5963d38)
2007-10-10r18129: moved the system includes into libreplace - this gives much moreAndrew Tridgell1-31/+4
isolation of our portability environment from the main code, and also simplifies the includes system (no separate #ifdef _SAMBA_BUILD for tdb. ldb etc now) (This used to be commit 77d1a468e06290aba789e2f3affc769fc5159a21)
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 Bartlett1-3/+2
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-10r16774: This patch modifies the tdb API to allow the logging function to be usedAndrew Bartlett1-1/+2
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-10r14799: added a tdb_get_seqnum() call, and the TDB_SEQNUM flag. This allowsAndrew Tridgell1-1/+3
for an extremely lightweight test to see if a tdb has possibly changed. (This used to be commit f325ba605ccceca63712c0f2c98961e35e437b3d)
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-10r10495: older redhat boxes need sys/time.h for select()Andrew Tridgell1-0/+3
(This used to be commit a11762e7bc139b0280e457e682722d955b81d8e5)
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 Tridgell1-0/+1
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-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-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 Tridgell1-0/+1
don't end up doing a mmap read only (This used to be commit 294ccfd46a0c4e1af9365d028acdabec03c41ad3)
2007-10-10r10459: fixed some portability problemsAndrew Tridgell1-0/+2
(This used to be commit 03942dd54b31e7a4cf9c6270b26ccf68a3234b40)
2007-10-10r10421: following on discussions with simo, I have worked out a way ofAndrew Tridgell1-0/+1
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 Tridgell1-12/+35
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-10r10253: a fairly large tdb cleanup and re-organise. Nearly all of this changeAndrew Tridgell1-0/+208
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)