summaryrefslogtreecommitdiff
path: root/source3/lib/gencache.c
AgeCommit message (Collapse)AuthorFilesLines
2010-12-22s3:lib/gencache: fix memory leak in error pathStefan Metzmacher1-0/+3
metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Wed Dec 22 15:08:30 CET 2010 on sn-devel-104
2010-11-28s3: Add gencache_iterate_blobsVolker Lendecke1-57/+87
2010-11-28s3: Convert gencache_get_data_blob to gencache_parseVolker Lendecke1-59/+38
2010-11-28s3: Add gencache_parseVolker Lendecke1-0/+59
2010-09-27Change to using TDB_INCOMPATIBLE_HASH (the jenkins hash) on allJeremy Allison1-4/+4
TDB_CLEAR_IF_FIRST tdb's. For tdb's like gencache where we open without CLEAR_IF_FIRST and then with CLEAR_IF_FIRST if corrupt this is still safe to use as if opening an existing tdb the new hash will be ignored - it's only used on creating a new tdb not opening an old one. Jeremy.
2010-03-28s3: Use tdb_transaction_start_nonblock in gencache_stabilizeVolker Lendecke1-1/+10
This avoids the thundering herd problem when 5000 smbds exit simultaneously because the network went down.
2010-03-28Revert "s3: Optimize gencache for smbd exit"Volker Lendecke1-75/+14
This reverts commit 5ca63676dc59e83ffd9560fdcfa26063f267f283. That does not fully fix the problem, adding a tdb_transaction_start_nonblock to fix it.
2010-03-24s3: Optimize gencache for smbd exitVolker Lendecke1-14/+75
If thousands of smbds try to gencache_stabilize at the same time because the network died, all of them might be sitting in transaction_start. Don't do the stabilize transaction if nothing has changed in gencache_notrans.tdb. Volker
2009-12-07s3: let gencache_init() use tdb_check()Stefan Metzmacher1-0/+25
If the check fails we try to clear the tdb and start with an empty cache. metze
2009-11-02s3-gencache: restore gencache_get behavior with NULL args (with torture test).Günther Deschner1-4/+8
Without this, we panic in wins_srv_is_dead() and fail to start nmbd with wins support. Volker, please check. Guenther
2009-09-28s3:gencache: Add my copyrightVolker Lendecke1-0/+1
2009-09-23s3:gencache: Make gencache_del() return success for expired entriesVolker Lendecke1-4/+13
This fixes nasty error messages from "net cache flush"
2009-09-23s3:gencache: Remove some over-paranoid lockingVolker Lendecke1-6/+0
2009-09-23s3:gencache: Add a "was_expired" argument to gencache_get_data_blobVolker Lendecke1-10/+19
This is set to true if the routine returns failure due to an existing but expired entry.
2009-07-15Consolidate gencache also every 100 writes in a single processVolker Lendecke1-0/+14
2009-07-15Consolidate string and data_blob routines in gencacheVolker Lendecke1-138/+56
2009-07-15Make gencache more stableVolker Lendecke1-15/+268
This provides a compromise between stability and performance: gencache is a persistent database these days that for performance reasons can not use tdb transactions for all writes. This patch splits up gencache into gencache.tdb and gencache_notrans.tdb. gencache_notrans is used with CLEAR_IF_FIRST, writes to it don't use transactions. By default every 5 minutes and when a program exits, all entries from _notrans.tdb are transferred to gencache.tdb in one transaction.
2009-07-15Remove gencache_init/shutdownVolker Lendecke1-20/+1
gencache_get/set/del/iterate call gencache_init() internally anyway. And we've been very lazy calling gencache_shutdown, so this seems not really required.
2009-07-15Remove gencache_[un]lock_keyVolker Lendecke1-25/+0
2009-07-15TDB_CONTEXT -> "struct tdb_context"Volker Lendecke1-1/+1
2009-07-15Replace ASSERTs in gencache with "return false"Volker Lendecke1-12/+18
It's a bit strong to panic here I think.
2009-01-19simplify gencache_iterate a bit, fix nonempty blank linesVolker Lendecke1-86/+84
2008-07-11Revert "Return timed out entries from gencache_get if timeout param != NULL"Volker Lendecke1-15/+10
This reverts commit 2954b2be563149380e1fae7fe088b98d6cbd42e7. (This used to be commit 77ab2fb306a7ad59447a3e1591c2af03447e09c5)
2008-07-11Revert "Remove gencache_[un]lock_entry"Volker Lendecke1-0/+25
This reverts commit 7a5a575ffe5196caecedc93970a25abfbe6f8059. (This used to be commit 62e444dd50ae974c2ab9a553cdf7f188a8f2c538)
2008-07-03Remove gencache_[un]lock_entryVolker Lendecke1-25/+0
Günther agreed that it might be unnecessary in dsgetdcname_cache_store() :-) (This used to be commit 7a5a575ffe5196caecedc93970a25abfbe6f8059)
2008-07-03Return timed out entries from gencache_get if timeout param != NULLVolker Lendecke1-10/+15
net cache get was the only one interested in the timeout. That single caller can take care of the timeout itself then. With this API change idmap_cache.c can be converted to gencache. (This used to be commit 2954b2be563149380e1fae7fe088b98d6cbd42e7)
2008-05-08gencache: add some const.Günther Deschner1-1/+1
Guenther (This used to be commit ec9f8c4cf67c82f4665ed51e4fd0181f5f147ea0)
2008-02-25Fix some warningsVolker Lendecke1-6/+6
warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result (This used to be commit ad37b7b0aee265a3e4d8b7552610f4b9a105434d)
2007-12-28don't store cache_readonly in gencacheVolker Lendecke1-15/+0
tdb won't allow us to write anyway (This used to be commit 069cd6d63a61065be7926230235e198c456d38ae)
2007-10-18RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison1-11/+11
bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
2007-10-10r24733: Add support for storing DATA_BLOBs in gencache.tdb (including ↵Günther Deschner1-0/+157
torturetest). Mimir, please have a look. DATA_BLOBs will now just show up as "DATA_BLOB" values with "net cache list". Guenther (This used to be commit b8ad546d041a2a8cc85c7db8eba4d2d3b97df1a8)
2007-10-10r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell1-2/+1
(This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07)
2007-10-10r23779: Change from v2 or later to v3 or later.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
2007-10-10r22009: change TDB_DATA from char * to unsigned char *Stefan Metzmacher1-3/+3
and fix all compiler warnings in the users metze (This used to be commit 3a28443079c141a6ce8182c65b56ca210e34f37f)
2007-10-10r21976: make use of tdb_*_bystring() and string_term_tdb_data() in lib/Stefan Metzmacher1-17/+9
to avoid creating the TDB_DATA struct from strings "by hand" metze (This used to be commit c22b86595a502eb48c9d0038faee8a9ee41b8438)
2007-10-10r19415: oh la la, always compile before commit, I'm very sorry.Günther Deschner1-6/+1
Guenther (This used to be commit bdd2e0361ce53a4f10fca767f734991797e7f927)
2007-10-10r19414: gencache is getting really important now, make sure that lp_lockdirGünther Deschner1-1/+1
always exists so that the gencache.tdb can get created there. Guenther (This used to be commit e5ed286125d1f4b8b28bf143f987102071fd0de2)
2007-10-10r19054: Callers of gencache may not have the rights toJeremy Allison1-0/+18
open read/write. Allow them to fallback to read-only. Jeremy (This used to be commit ec526e1b882e3ade23f90c5e3d637c72b6839da5)
2007-10-10r18312: Change gencache_get slightly: Delete expired keys, and only strdup ↵Volker Lendecke1-1/+10
the value if a valid entry was found. The newer calls got the latter one wrong, change the older calls. Volker (This used to be commit 554e68887bc84510690226c9b07a872e7a282abe)
2007-10-10r18311: Simplify gencache_get by using strtol instead of sscanfVolker Lendecke1-50/+28
(This used to be commit f6497adac674f9e5089a2e54ead07596e568a936)
2007-10-10r18310: Add a little test for some gencache routinesVolker Lendecke1-67/+7
Remove unused gencache_set_only Use CONST_DISCARD instead of SMB_STRDUP Volker (This used to be commit 651e7e44e2e56eab81c5fe708f33e6d3918a39f9)
2007-10-10r17928: Implement the basic store for CLDAP sitenameJeremy Allison1-2/+0
support when looking up DC's. On every CLDAP call store the returned client sitename (if present, delete store if not) in gencache with infinate timeout. On AD DNS DC lookup, try looking for sitename DC's first, only try generic if sitename DNS lookup failed. I still haven't figured out yet how to ensure we fetch the sitename with a CLDAP query before doing the generic DC list lookup. This code is difficult to understand. I'll do some experiments and backtraces tomorrow to try and work out where to force a CLDAP site query first. Jeremy. (This used to be commit ab3f0c5b1e9c5fd192c5514cbe9451b938f9cd5d)
2007-10-10r17334: Some C++ warningsVolker Lendecke1-2/+2
(This used to be commit 8ae7ed1f3cecbb5285313d17b5f9511e2e622f0b)
2007-10-10r16290: Fix Coverity bugs 298 and 298Volker Lendecke1-4/+4
(This used to be commit b96808bb623c01f2515fdbdede8b4e9edebff23b)
2007-10-10r16267: Fix Klocwork #401, #402 - ensure format specifierJeremy Allison1-15/+59
limited. Fix memleak in printing gencache contents. Jeremy. (This used to be commit 81731e1f68cdf4af80733338238aeae0a7d108c0)
2007-10-10r15101: Little step towards getting Samba4 tdb into 3: tdb_lock_bystring ↵Volker Lendecke1-1/+1
does not have the timeout argument in Samba4. Add a new routine tdb_lock_bystring_with_timeout. Volker (This used to be commit b9c6e3f55602fa505859a4b2cd137b74105d685f)
2007-10-10r13310: first round of server affinity patches for winbindd & net ads joinGerald Carter1-11/+9
(This used to be commit 6c3480f9aecc061660ad5c06347b8f1d3e11a330)
2007-10-10r12912: patch from Tony Mountifield <tony@softins.co.uk> for BUG 3327 (fix ↵Gerald Carter1-1/+4
bad access to gencache.tdb after fork() in smbmount (This used to be commit 68399ce04ca4509d51950d2d7b1ed817e82bf17c)
2007-10-10r10656: BIG merge from trunk. Features not copied overGerald Carter1-2/+14
* \PIPE\unixinfo * winbindd's {group,alias}membership new functions * winbindd's lookupsids() functionality * swat (trunk changes to be reverted as per discussion with Deryck) (This used to be commit 939c3cb5d78e3a2236209b296aa8aba8bdce32d3)
2007-10-10r4088: Get medieval on our ass about malloc.... :-). Take control of all our ↵Jeremy Allison1-12/+11
allocation functions so we can funnel through some well known functions. Should help greatly with malloc checking. HEAD patch to follow. Jeremy. (This used to be commit 620f2e608f70ba92f032720c031283d295c5c06a)