summaryrefslogtreecommitdiff
path: root/lib/dbwrap
Commit message (Collapse)AuthorAgeFilesLines
...
* dbwrap: Remove dbwrap_watchers.tdb based codeVolker Lendecke2016-07-153-30/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* build: Address may be used uninitialized in this function on Ubuntu 10.04Andrew Bartlett2016-06-081-1/+2
| | | | | | | | | | This is not found by modern compilers, but prevents the -Werror -O3 build on Ubuntu 10.04 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jun 8 08:48:57 CEST 2016 on sn-devel-144
* lib: Avoid "includes.h" in dbwrap.cVolker Lendecke2016-03-061-1/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* dbwrap: add dbwrap_purge[_bystring]Michael Adam2016-03-012-0/+19
| | | | | | | | Variants of dbrwap_delete[_bysrting] that treats NOT FOUND as success. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* dbwrap_util: improve a debug message in dbwrap_delete_action()Michael Adam2016-03-011-1/+2
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* dbwrap_file: fix use of read_data()Uri Simchoni2016-01-271-6/+5
| | | | | | | | Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jan 27 00:09:05 CET 2016 on sn-devel-144
* Rename 'errors' to 'samba-errors' and make it public.Jelmer Vernooij2016-01-131-1/+1
| | | | | | | | | | | This is necessary because it has public headers. Signed-off-by: Jelmer Vernooij <jelmer@jelmer.uk> Reviewed-By: Andrew Bartlett <abartlet@samba.org> Reviewed-By: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org> Autobuild-Date(master): Wed Jan 13 07:47:04 CET 2016 on sn-devel-144
* dbwrap_rbt: fix modifying the db during traverseStefan Metzmacher2015-11-271-47/+57
| | | | | | | | | | | | | | | | | | | | We delete and add of records rebalace the tree, but our traverse code doesn't handle that and skips records randomly. We maintain records in a linked list for now in addition to the rbtree and use that list during traverse. This add a bit overhead, but at least it works reliable. If someone finds a way to do reliable traverse with the rebalanced tree, we can replace this commit. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11375 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11394 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* dbwrap_rbt: add nested traverse protectionStefan Metzmacher2015-11-271-31/+40
| | | | | | | | | | | | | | | | | | Multiple dbwrap_traverse_read() calls are possible. store() and delete() on a fetch locked record are rejected during dbwrap_traverse_read(). A dbwrap_traverse() within a dbwrap_traverse_read() behaves like a dbwrap_traverse_read(). Nested dbwrap_traverse() calls are not possible. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11375 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11394 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* dbwrap_rbt: use talloc_zero_size() instead of a partial ZERO_STRUCT()Stefan Metzmacher2015-11-271-3/+1
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11375 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11394 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* dbwrap_tdb: Fix a typoVolker Lendecke2015-11-231-1/+1
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Mon Nov 23 15:16:19 CET 2015 on sn-devel-104
* lib: dbwrap_local_open references loadparm_contextVolker Lendecke2015-10-281-0/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* dbwrap: Make dbwrap_db_id return size_tVolker Lendecke2015-09-226-13/+21
| | | | | | | This will make an on-stack db-id easier Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* dbwrap: Remove talloc_reference()Volker Lendecke2015-09-221-1/+1
| | | | | | | | We want to know (by crashing) when we free the database with records still around. This would be a serious violation of our data structure hierarchies. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* dbwrap: Remove unused dbwrap_hash_size()Volker Lendecke2015-09-225-9/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* dbwrap: Remove loadparm_context from db_open_tdbVolker Lendecke2015-09-223-10/+8
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* dbwrap_rbt: Make "key" and "value" aligned to 16 byteVolker Lendecke2015-07-201-12/+39
| | | | | | | | | | Reported by Uri Simchoni <urisimchoni@gmail.com>. Thanks! Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Mon Jul 20 23:18:23 CEST 2015 on sn-devel-104
* dbwrap: Remove an unused variableVolker Lendecke2015-05-131-2/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dbwrap: Remove a ntdb referenceVolker Lendecke2015-03-171-5/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* Remove ntdb protection from db_open_tdbVolker Lendecke2015-03-171-7/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* dbwrap: Remove dbwrap_ntdbVolker Lendecke2015-03-173-626/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* dbwrap: Remove ntdb logic from dbwrap_local_openVolker Lendecke2015-03-171-184/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* ntdb: always return int from tdb_store_flag_to_ntdb()David Disseldorp2015-02-261-0/+1
| | | | | | | | Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Thu Feb 26 13:49:05 CET 2015 on sn-devel-104
* dbwrap: Add code to marshall a db_context's dbVolker Lendecke2014-12-162-0/+175
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dbwrap: Fix a enum conversionVolker Lendecke2014-11-241-1/+1
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Nov 24 18:36:00 CET 2014 on sn-devel-104
* dbwrap: Avoid "includes.h" in dbwrap_cache.cVolker Lendecke2014-10-301-3/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dbwrap: Add some required #includes to dbwrap.hVolker Lendecke2014-10-301-0/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dbwrap: Avoid an unnecessary #includeVolker Lendecke2014-10-301-5/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tdb_wrap: Remove tdb_wrap_open_ againVolker Lendecke2014-03-311-3/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dbwrap: Avoid passing lp_ctx to tdb_wrap_open in db_open_tdbVolker Lendecke2014-03-311-2/+8
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dbwrap: completely check validity of lock order in dbwrap_check_lock_order()Michael Adam2014-02-071-1/+1
| | | | | | | | | | | This is currently not strictly necessay, because the only caller catches the DBWRAP_LOCK_ORDER_NONE case, and maximum is already checked, but this seems too dangerous to me. Use the new DBWRAP_LOCK_ORDER_VALID() macro. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dbwrap: add a comment explaining the supported lock ordersMichael Adam2014-02-071-0/+4
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dbwrap: add DBWRAP_LOCK_ORDER_VALID()Michael Adam2014-02-071-0/+4
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dbwrap: add DBWRAP_LOCK_ORDER_MINMichael Adam2014-02-071-0/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dbwrap: move definition of DBWRAP_LOCK_ORDER_MAX to the private header.Michael Adam2014-02-072-1/+2
| | | | | | | This is only needed internally. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dbwrap: explicitly use DBWRAP_LOCK_ORDER_NONE in tdb->ntdb conversionMichael Adam2014-02-071-2/+4
| | | | | | | Make lack of lock order checking more visible. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dbwrap: introduce DBWRAP_LOCK_ORDER_NONE for lock order "0".Michael Adam2014-02-072-1/+2
| | | | | | | | | | | | Ther are still some databases which are opened (locally) with lock oder 0, which means don't do lock oder checking, thereby circumventing this deadlock-prevention mechanism. Add a symbolic constant for this "0" to make this circumvention more explicit. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dbwrap: add dbwrap_flags argument to dbwrap_local_open()Michael Adam2014-02-072-2/+4
| | | | | | | | To be consistent with db_open() and prepare for future possible extensions. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dbwrap: add a dbwrap_flags argument to db_open_ntdb()Michael Adam2014-02-073-4/+7
| | | | | | | | for consistency and to perpare for possible future flags that the ntdb backend might be aware of. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dbwrap: add a dbwrap_flags argument to db_open_tdb()Michael Adam2014-02-073-4/+6
| | | | | | | | ...for consistency and in preparation of future flags that the tdb backend might be aware of. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dbwrap: add DBWRAP_FLAG_OPTIMIZE_READONLY_ACCESSMichael Adam2014-02-071-0/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dbwrap: add flags DBWRAP_FLAG_NONEMichael Adam2014-02-071-0/+2
| | | | | | | | This is in preparation of adding a dbwrap_flags argument to db_open and firends. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dbwrap: No lock_order check if not requiredVolker Lendecke2013-12-141-13/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dbwrap_cache: Check negative firstVolker Lendecke2013-12-141-3/+3
| | | | | | | | dbwrap_cache is right now used for notify most, and we hope to have very few notifies around. So negative hits will be more likely than positive Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dbwrap_cache: Fix dbwrap_cache_validateVolker Lendecke2013-12-141-2/+14
| | | | | | | Classic brown paper bag bug :-( Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dbwrap: Avoid a stackframe in fetch_locked_internalVolker Lendecke2013-12-141-5/+2
| | | | | | | | This shows in profiles. We call this so often that this is a pretty hot code path. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Revert "dbwrap: dbwrap_fetch_locked_timeout()."Volker Lendecke2013-06-065-160/+0
| | | | | | | | | | This reverts commit f6eb187fdab6b8088bb065e418fe604c4eba7751. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Rusty Russell <rusty@rustcorp.com.au> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Thu Jun 6 14:26:26 CEST 2013 on sn-devel-104
* dbwrap: Fix CID 1002092 Uninitialized scalar variableVolker Lendecke2013-05-121-1/+3
| | | | | | | We don't set saved_errno in the ret==0 case. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* ntdb: remove --disable-ntdb.Rusty Russell2013-04-131-8/+0
| | | | | | | | | | | Remove DISABLE_NTDB option, and --disable-ntdb from waf build. This just means that it will always get built: it isn't used by default yet. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Apr 13 02:01:02 CEST 2013 on sn-devel-104
* dbwrap: Add a comment explaining a restrictionVolker Lendecke2013-03-271-0/+11
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed Mar 27 13:40:15 CET 2013 on sn-devel-104