summaryrefslogtreecommitdiff
path: root/source3/tdb/tdb.c
AgeCommit message (Collapse)AuthorFilesLines
2000-12-15Added lock backouts on fail.Jeremy Allison1-3/+28
When chaining together long lines of bloody "if" statements, which should logically be separated, and one of them allocates memory, remember to *free* it *WHETHER OR NOT THE IF STATEMENTS SUCCEEDED* !!!! Yes I do consider this a bug in the coding style of Tridge, Rusty, Tim et al. :-). I'm just pissed 'cos this took 4 hours to track down even with an insure error report stating me in the face and also Ben Woodward looking over the code with me :-). Jeremy. (This used to be commit 506b5e34c3ba16768dbc82ba21044787de160c45)
2000-12-13Two tdb bugfixes. First one - ensure that traverse lock is moved before deletingJeremy Allison1-45/+58
dead records, else the record is just marked for deletion, not actually deleted. Second, ensure allocated record is marked as "in use" before free list lock is released, else other processes in the freelist merge code may try and merge it. Jeremy. (This used to be commit dd959fa325c5df8ce0407d8debea76602c8e71cf)
2000-12-11Added Tim's fix for read-only crashes.Jeremy Allison1-0/+2
Jeremy. (This used to be commit cfc62fecdf4c5579ee643df3e701cf6f1fe553ee)
2000-12-07Fixed bug with tdb_next_lock failing when reaching then end of a hashchainJeremy Allison1-9/+10
and the next hashchain is empty. Jeremy (This used to be commit f3b5e2a172a777e1c3bbf6ac72fe5c7cdb8324b3)
2000-12-06Changed to sourceforge tdb code. This includes spinlocks (so we now haveJeremy Allison1-1013/+717
a --with-spinlocks option to configure, this does mean the on-disk tdb format has changed, so 2.2alphaX sites will need to re-create their tdb's. The upside is no more tdb fragmentation and a +5% on netbench. Swings and roundabouts.... Jeremy. (This used to be commit 9dea7b7c257db487f8ced7dad3fce92fba03ea91)
2000-12-05Fixed one tdb_read -> rec_free_read call.Jeremy Allison1-10/+2
Jeremy. (This used to be commit c9884e16fc2d13dd62c5a43633c9a38dadc9822c)
2000-12-05Added sorted freelist neighbour merge code to stop tdb fragmentation.Jeremy Allison1-32/+212
This needs TESTING !!! (It passes tdbtest of course :-). Jeremy. (This used to be commit 7ae54a93e756d927419242adf35f46e91e974573)
2000-12-02Added print_freelist command.Jeremy Allison1-0/+35
Jeremy. (This used to be commit ee89ca9e68abb23fc26cd1378e02e56d0d725e55)
2000-12-02change the split threahold for the free list to prevent freelistAndrew Tridgell1-1/+1
fragmentation (This used to be commit b64e1ae69314ae110c548f57810c34e620d57075)
2000-11-27fixed a potential locking deadlock in tdbAndrew Tridgell1-1/+1
(This used to be commit 03453e2ae557d7fa119338b71744822093d2f38a)
2000-10-10got rid of tdb_writelock() and instead lock a chain. tdb_writelock()Andrew Tridgell1-25/+0
is conceptually flawed (This used to be commit 6e4a3585521b7e5928298bd0f1418ff9fbcacfb4)
2000-10-05Herb's fixes for profiling & compiler warnings.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 7914e9351abb5271ebb4990c3b1fe495d15a4eda)
2000-10-02Added debug so if zero length messages get sent we successfully removeJeremy Allison1-3/+7
them (this can happen if smbd processes are shut down at the wrong time). Jeremy. (This used to be commit c1de97f96b8c5ad8e5f01a0d17c6387733769442)
2000-06-15- use read locks when possibleAndrew Tridgell1-42/+44
- don't use as many locks on a store (This used to be commit ee12b10d21022287baf4432d1df743c4b28223b2)
2000-05-12an imcompatible tdb format change (sorry!)Andrew Tridgell1-11/+2
this will give us a much nicer migration path for the proposed semaphore code (This used to be commit 491ab241897a7252fb088c718de4bdf7f43f4ddc)
2000-05-10when creating the database zero the reserved spaceAndrew Tridgell1-0/+8
(This used to be commit a5ca60f62bea988e74e2827fbb848770ac5ae444)
2000-05-10- add some reserved space to every tdb, this will beAndrew Tridgell1-2/+3
used for semaphores and future expansion - update tdb version number to 2 (This used to be commit 5e04885b86791e6ef8b4a316e64d56c6eb05f35d)
2000-05-10Use a prime for default tdb hash size - this makes a difference !Herb Lewis1-1/+1
Jeremy. (This used to be commit 400906e6421c150b591b4bf978a641d5aaf8fd09)
2000-05-01fixed typoAndrew Tridgell1-1/+1
(This used to be commit 5341597de6772027034cad7dacbdbd6d2108332a)
2000-05-01added TDB_INTERNAL, TDB_NOLOCK and TDB_NOMMAP flags.Andrew Tridgell1-40/+63
TDB_INTERNAL replaces the old method of passing a null filename (This used to be commit 8ec815920d46f205b9f3fff82397c731753c3a10)
2000-04-30- removed all our old wildcard matching code and replaced it with aAndrew Tridgell1-20/+15
call to ms_fnmatch(). This also removes all the Win9X semantics stuff and a bunch of other associated cruft. - moved the stat cache code into statcache.c - fixed the uint16 alignment requirements of ascii_to_unistr() and unistr_to_ascii() - trans2 SMB_FIND_FILE_BOTH_DIRECTORY_INFO returns the short name as unicode always (at least thats what NT4 does) - fixed some errors in the in-memory tdb code. Still ugly, but doesn't crash as much (This used to be commit 03e9cea004bbba72161a5323cf3b4556c94aed8e)
2000-04-29put tdb utility functions in a separate fileAndrew Tridgell1-44/+0
(This used to be commit 77009422a075300e5c07a3e75806a7dac47e2113)
2000-04-28Added tdb_get/set_int_byblob, which takes a size_t len and then implementedJeremy Allison1-7/+19
the tdb_get/set_int string functions in terms of them. Will be useful in storing POSIX pending close records (which are ints but indexed by dev/inode pairs). Jeremy. (This used to be commit d69e4c6a48746459f973144393529b1f40680d2f)
2000-04-25added TDB_MODIFY flag - patch from from lukeAndrew Tridgell1-4/+25
(This used to be commit 90b574296e06cd6ed4fedc1e5a8ae412a5e78b45)
2000-04-24use an size_t not a ssize_t when checking for out of bounds errorsAndrew Tridgell1-1/+1
(This used to be commit 044af3cf977e3172b3b1ce3f71457d5b0a4fc1b2)
2000-04-16added tdb_get_int() and tdb_store_int()Andrew Tridgell1-0/+34
they are very useful for database versioning (This used to be commit cc65914cdcceb1fdeeb5d6ec1cf2ea2f865c5092)
2000-03-01Check for null tdb context in tdb_exists()Tim Potter1-0/+7
(This used to be commit bbacdb834f9c8f8c34368664def42dabe78d90c9)
2000-02-28Allow tdb databases to be created "in memory" without having a fileTim Potter1-55/+99
associated with them. tdb can then be used as a hash table data structure. (This used to be commit b345c0a1058bcde7689bb9566535e9f1c46ee173)
2000-02-16More checks for passing NULL tdb contexts to tdb functions.Tim Potter1-0/+77
(This used to be commit 7faa70d254549e60520de1ed1112d41fe9a4d77c)
2000-02-15Return "Invalid tdb context" instead of crashing when tdb_error calledTim Potter1-2/+6
with NULL tdb context. (This used to be commit ba9f24c0964054f22cd8f0de32cfeacb88b4800c)
2000-02-041) added void* state argument to tdb_traverse. guess what! there wereLuke Leighton1-3/+3
two places i found where it was appropriate to _use_ that third argument, in locking.c and brlock.c! there was a static traverse_function and i removed the static variable, typecast it to a void*, passed it to tdb_traverse and re-cast it back to the traverse_function inside the tdb_traverse function. this makes the use of tdb_traverse() reentrant, which is never going to happen, i know, i just don't like to see statics lying about when there's no need for them. as i had to do in samba-tng, all uses of tdb_traverse modified to take the new void* state argument. 2) disabled rpcclient: referring people to use SAMBA_TNG rpcclient. i don't know how the other samba team members would react if i deleted rpcclient from cvs main. damn, that code's so old, it's unreal. 20 rpcclient commands, instead of about 70 in SAMBA_TNG. (This used to be commit 49d7f0afbc1c5425d53019e234d54ddf205c8e9a)
2000-01-24tdb record read error return check fix from Dave Airlie <airlied@samba.org>.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 82c99dc8d8bc79e88f0db651f04fc23508195a51)
2000-01-14casts and defines to make solaris happyAndrew Tridgell1-0/+4
(This used to be commit 77cf152c02b445f4b6e9de393936dd6e54e6f442)
2000-01-08improved the error checkingAndrew Tridgell1-26/+73
(This used to be commit 2a152998a1489dead0edadb06f78b0ad6ede1a3a)
2000-01-07don't use strcpyAndrew Tridgell1-1/+2
(This used to be commit bf9b1328c5843eb217eff4ca05645498de2def82)
2000-01-07- patch from Rusty to neaten up the code a bitAndrew Tridgell1-232/+106
- fixed a race condition in tdb_open() (This used to be commit 21d4882f64a65ee1786231eb55b7768bb44921fd)
2000-01-05lower the default hash size a bitAndrew Tridgell1-1/+1
(This used to be commit 51ed6e8cec47642641e6b26682fd6f25624b19ae)
2000-01-03drop the alignment to 4 bytes - this makes tdb more space efficientAndrew Tridgell1-1/+1
and doesn't seem to affect performance (This used to be commit 1fb293732ed65deba6958000a9f6de7900e21f5c)
2000-01-02updated docsAndrew Tridgell1-1/+1
(This used to be commit c199ec9543d0d84bd5ea29078887684f708c9637)
2000-01-02- added tdb_flags option to tdb_open()Andrew Tridgell1-13/+40
- added TDB_CLEAR_IF_FIRST flag to clear the database if this is the first attached process. Useful for non-persistent databases like our locking area (this will also make upgrades to new database layouts easier) - use lock_path() in a couple of places - leave connections database open while smbd running - cleaned up some tdb code a little, using macros for constants (This used to be commit 00e9da3ca577527db392aced62f02c69cfee8f4f)
2000-01-02- optimise tdb_store() a littleAndrew Tridgell1-7/+15
- prevent a free of an unallocated pointer (This used to be commit b35b5c63886823bb8b8d8c5c29ccc7b315a7de30)
1999-12-24fixed more locking bugs - all seems OK nowAndrew Tridgell1-39/+66
(This used to be commit 584537961b6134a50089d37328a21c617bc6547b)
1999-12-23fixed locking codeAndrew Tridgell1-69/+194
(This used to be commit 1f5dc924044fb54b10ac8884d4df1e15902de8be)
1999-12-22fixed a bug in the handling of tdb version number upgradeAndrew Tridgell1-0/+3
(This used to be commit ed7541668e9bc98ae9daf55f817d2de04345e660)
1999-12-22added some paranoia codeAndrew Tridgell1-41/+46
(This used to be commit c547ffa9e9ce68a77f63591b37b690a83a956348)
1999-12-21converted all our existing shared memory code to use a tdb databaseAndrew Tridgell1-31/+34
instead of either sysv or mmap shared memory or lock files. this means we can now completely remove locking_shm.c locking_slow.c shmem.c shmem_sysv.c and lots of other things also got simpler locking.c got a bit larger, but is much better compartmentalised now (This used to be commit e48c2d9937eea0667b8cd3332e49c06314ef31e7)
1999-12-21first cut at using the tdb code for the connections structure, theAndrew Tridgell1-4/+35
SWAT status page and smbstatus. It made the code _much_ simpler, I wish we'd done a database module a long time ago! (This used to be commit 4951755413c11d4c5b9af4699a6e622056d52433)
1999-12-21first pass at the database code for Samba. This also includes a testAndrew Tridgell1-0/+1001
suite and a very simple tool for manuipulating the databases. the main code is in tdb/tdb.c and includes both mmap and file based IO. All databases auto-expand and allow multiple simultaneous writers. the next step is using this new capability in lots of places in Samba where we have existing ad-hoc databases (This used to be commit c89d29cc5e3b6d568928acace01144059f1668b3)