summaryrefslogtreecommitdiff
path: root/source4/lib/tdb/common
AgeCommit message (Collapse)AuthorFilesLines
2008-05-20Convert in_transaction to a bool. Add the same fix VolkerJeremy Allison1-4/+9
used for tdb_traverse() to tdb_traverse_read(). Jeremy. (This used to be commit e05ec3047c4fe0cc2e09a812830fc835dc35abea)
2008-05-20Fix nesting tdb_traverse in a transactionVolker Lendecke1-3/+8
Calling tdb_traverse inside a transaction led to the transaction lock being held indefinitely. This was caused by the tdb_transaction_lock/unlock inside tdb_traverse: The transaction code holds the global lock at offset TRANSACTION_LOCK. The call to tdb_transaction_lock does nothing because the transaction_lock is already being held. tdb_transaction_unlock inside tdb_wrap resets tdb->have_transaction_lock but does not release the kernel-level fcntl lock. transaction_commit later on does not release that fcntl lock either, because tdb->have_transaction_lock was already reset by tdb_transaction(). This patch does fix that problem for me. An alternative would be to make tdb->have_transaction_lock a counter that can cope with proper nesting, maybe in other places as well. Volker (This used to be commit 89543005fe2e4934b3c560c937d49304a32a7fc2)
2008-02-08merge tdb changes from ctdbAndrew Tridgell1-33/+47
(This used to be commit b3e60a388d338ef90540007239e88563cb9ba27a)
2008-02-07merge growing tdb for tdb_wipe_all() fix from ctdbAndrew Tridgell1-0/+43
(This used to be commit df4efb902ec5053ae9d7c6e4fd1e21255ca66914)
2008-01-31merged tdb transaction fixAndrew Tridgell1-0/+3
(This used to be commit eb3af24926977208a8099c848a510704d2ae3524)
2008-01-18merged changes from v3-2-testAndrew Tridgell5-48/+11
(This used to be commit 7077df3e2e3f171532f6a5ac87d45201736c9c11)
2008-01-18merged tdb changes from ctdbAndrew Tridgell3-59/+49
(This used to be commit c54c087a19e36e0522eb4546c9425ae446f0628b)
2008-01-15merged tdb from ctdb bzr treeAndrew Tridgell8-210/+466
(This used to be commit ed0c3a0f74c305b3b8554b05c3f97cf79db8296a)
2007-12-21r25893: Fix ldb, tdb builds (and one warning).Jeremy Allison1-1/+1
Jeremy. (This used to be commit 52b26645b04a9c5fb70e7b869b60c9157f821d50)
2007-12-21r25892: Keep the tdb code in sync between 3.2.x and 4.0.Jeremy Allison3-3/+19
Add in the alarm fix to allow locks to exit on alarm signal. Sync up the changes in tools. Jeremy. (This used to be commit cb6c663fa8818f49cc36f196bb5f4dea47edd69e)
2007-10-10r24738: Fix one more use of pwrite in tdb code in the spirit of r23972 and ↵Michael Adam1-6/+25
r23977. Michael (This used to be commit 7b2cabea55cebb98e0fcee17066a0871667cd83f)
2007-10-10r24337: Make libreplace provide offsetof.Jelmer Vernooij1-4/+0
(This used to be commit 48d1aa4fcf6a323e3e6a14825f83cd20e3fc3a26)
2007-10-10r24336: Use standard data type uint32_t rather than tdb-specific u32.Jelmer Vernooij8-59/+56
(This used to be commit f90a698387c53508862eb6359bd4d1fba1d2b4b0)
2007-10-10r23980: Fix one more use of pwrite in expand_file.Michael Adam1-1/+10
Michael (This used to be commit b97acdc67b1a55529e69bb7b2b78a317a34b1eba)
2007-10-10r23979: Fix another occurence of (written != requested) as anMichael Adam1-5/+22
error condition to write. This is in tdb_new_database. Fix one call to tdb_new_database in tdb_open_ex to not overwrite the newly propagated errno (typically ENOSPC). Michael (This used to be commit eb524df0a52783de6c94a11b44f268e0f26fbb2c)
2007-10-10r23978: Merge r23161 from Samba3:Michael Adam1-0/+4
Add TDB_VOLATILE as open_flag to activate the per-hashchain dead record optimization. (This used to be commit 868cdb1781fe94afbc1658e72bf06de20193bcd7)
2007-10-10r23977: Im prove the pwrite-patch to tdb_expand_file of r23972:Michael Adam1-7/+20
* prevent infinite loops due to 0 bytes written: try once more. if we still get 0 as return, set errno to ENOSPC and return -1 (error) * replace int by correct types (ssize_t and size_t). * print a warning log message in case "written < requested to write" usually this means, that the next call to pwrite will fail with return value -1 and set errno accordingly. Note that the former error condition "written != requested to write" is not a correct error condition of write/pwrite. If this is due to an error, a subsequent call to (p)write will reveal the cause (typically "no space left on device" - ENOSPC). Michael (This used to be commit 7f415d12239fc67eb2c7894c6359b9507fe122c6)
2007-10-10r23972: Fix a bug in pwrite error detection in tdb_expand_file():Michael Adam1-3/+3
The proper error condition is (ret == -1) instead of (ret != number_of_byte_told_to_write). Michael (This used to be commit 4c3c6363f860ec01d3c789ef8ee2aa3eb77000dc)
2007-10-10r23798: updated old Temple Place FSF addresses to new URLAndrew Tridgell11-22/+11
(This used to be commit 40c0919aaa9c1b14bbaebb95ecce53eb0380fdbb)
2007-10-10r23795: more v2->v3 conversionAndrew Tridgell11-11/+11
(This used to be commit 84b468b2f8f2dffda89593f816e8bc6a8b6d42ac)
2007-10-10r23590: Fix realloc leak on failure case from Jim Meyering <jim@meyering.net>.Jeremy Allison1-1/+5
Jeremy. (This used to be commit 59ba128cb61e77a830ddd8b8e1d5d0fd00f99736)
2007-10-10r23371: Fix the misleading comment I added - it really *should*Jeremy Allison1-2/+2
say "locks chain and returned record", not "and returns record" Jeremy. (This used to be commit fa880e6cc16024f14d10cdc8120ce67bfd1d2eb6)
2007-10-10r23370: Traverse in tdb wasn't consistently using theJeremy Allison1-8/+10
travlocks.lock_rw for lock read/write types, it was sometimes using it (tdb_next_lock) and sometimes explicitly using F_WRLCK instead. Change this to consistently use travlocks.lock_rw only. I'm pretty sure about this fix (else I woudn't be checking this in :-) but tridge and Volker please review. Jeremy. (This used to be commit fa548ad75e945ae4d167baffb87140c90cba268c)
2007-10-10r23238: merged transaction lock changes from ctdbAndrew Tridgell4-14/+47
this ensures that having the global lock also implies the transaction lock (This used to be commit 9dbb2633d7781fcc5d15b175ef36bfda5eb199bb)
2007-10-10r22832: merged the latest tdb changes from ctdb to Samba4Andrew Tridgell2-15/+99
(This used to be commit a88ab4fa3a07c31bc45c612043f9e096f384eda4)
2007-10-10r22424: fixed the bad merge (thanks to metze for pointing out)Andrew Tridgell1-2/+2
(This used to be commit bffb8f88006fd2530cad270df642d9a23a01b34b)
2007-10-10r22422: merged tdb changes from ctdbAndrew Tridgell2-6/+31
(This used to be commit a0ff739bcab32065d9d3957eb1d93f7791f84f04)
2007-10-10r22319: sync lib/tdb/ with samba3Stefan Metzmacher4-10/+15
metze (This used to be commit 8f24f6b38e967075589529a08c68a1a56f9f0499)
2007-10-10r22165: merge transaction fix from samba3Andrew Tridgell1-0/+2
(This used to be commit ff78be0be4ef67ed25bfb837bd8a7bf4105367fb)
2007-10-10r22081: transaction_brlock() should be staticAndrew Tridgell1-2/+2
thanks to Ted T'so for pointing this out (This used to be commit 6921f2f7093bbb6c236f16947072026303e58439)
2007-10-10r22041: merge trivial changes from samba3Stefan Metzmacher5-15/+19
metze (This used to be commit 902a76ca705f07c61f86a9ef1346583ba9d3157d)
2007-10-10r21722: Add the dead record functionality presented on ↵Volker Lendecke3-6/+186
samba-technical@samba.org. If you do a tdb_set_max_dead(tdb, n), then for this tdb a delete operation will only mark a record as dead and re-use it if a new record is created. The parameter n allows for at most n dead records per hash chain. If this number is exceeded, all dead records are put on the central freelist. Volker (This used to be commit 98a27ab28a3cd554e370a9a0e3652f4dea8749e9)
2007-10-10r21445: Apply tdb_parse_record Tridges error return, merge to 3_0_25 and 4_0Volker Lendecke3-13/+90
(This used to be commit afe7d7855841066b88859976ac748cbf438a9a9f)
2007-10-10r21412: The last patch also incremented the seqnum when tdb_store failed. ↵Volker Lendecke1-8/+10
Not as bad as not doing it at all, but needs fixing. Also simplify the logic, I had missed the "goto out" at the end of the function. Volker (This used to be commit ed30a0ff602d0a1d4409bee4faf12b6979b5f4b8)
2007-10-10r21410: We have to increment the sequence number also when tdb_update_hash()Volker Lendecke1-1/+1
succeeded. Found while testing the brlock seqnum patch. Tridge, please check! Volker (This used to be commit e518c68fc5446304611d096ac2e3cab744734fc3)
2007-10-10r21303: As discussed on samba-technical: Change the static array for the ↵Volker Lendecke4-36/+96
in-memory mirrors of the hash chain locks to a dynamically allocated one. Jeremy, I count on you to revert it if the build farm freaks out, it's after midnight here :-) Volker (This used to be commit 7b5db2e472c7e27231fa432d3930789e708abd09)
2007-10-10r19960: Add code to check for loops in the free list.Jeremy Allison2-1/+109
Should help us validate tdb's against corruption. Jeremy. (This used to be commit bd0710fa09799cb496b1f9f365c57c3b542445f3)
2007-10-10r19428: moved tdbutil.c from lib/tdb/common/ to lib/util/util_tdb.cAndrew Tridgell1-549/+0
tdbutil.c is Samba specific, so should not be part of the generic tdb library (This used to be commit 979dd24f5e44605fc1603b690913b8c31be7478f)
2007-10-10r19425: two more tdb functions from samba3Andrew Tridgell1-0/+11
(This used to be commit c9d9d79c34e8a36a6f684b173b1cc861330adc5c)
2007-10-10r19423: merge some tdb changes from SAMBA_3_0 to SAMBA_4_0Andrew Tridgell4-12/+22
this is in preparation of a merge in the other direction (This used to be commit db3211079fd594aa03c3b9bb3eb6ad86bdd32837)
2007-10-10r19401: make tdb_lockall() much more efficient, and add a tdb_lockall_read()Andrew Tridgell6-68/+139
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-10r18301: I discovered how to load the warnings from a build farm build intoAndrew Tridgell2-2/+2
emacs compile mode (hint, paste to a file, and compile as "cat filename"). This allowed me to fix nearly all the warnings for a IA_64 SuSE build very quickly. (This used to be commit eba6c84efff735bb0ca941ac4b755ce2b0591667)
2007-10-10r18160: - pread and pwrite replacements need to be non-staticAndrew Tridgell1-22/+0
- replacing rename() is pointless - all platforms have it (and the #define of rename breaks some code) - use system/locale.h in snprintf.c - fix passwd.h for initgroups - stdlib is in replace.h, not needed elsewhere - fix the initgroups replacement - fix mapping of dl functions to rep_* (This used to be commit 57cd0ca176387d6a3acabf9fedeef4f2a3a3dad7)
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-10r17930: Merge noinclude branch:Jelmer Vernooij1-1/+1
* Move dlinklist.h, smb.h to subsystem-specific directories * Clean up ads.h and move what is left of it to dsdb/ (only place where it's used) (This used to be commit f7afa1cb77f3cfa7020b57de12e6003db7cfcc42)
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)