summaryrefslogtreecommitdiff
path: root/lib/dbwrap/dbwrap.c
Commit message (Collapse)AuthorAgeFilesLines
* 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: Make dbwrap_db_id return size_tVolker Lendecke2015-09-221-2/+2
| | | | | | | 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 unused dbwrap_hash_size()Volker Lendecke2015-09-221-5/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@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: introduce DBWRAP_LOCK_ORDER_NONE for lock order "0".Michael Adam2014-02-071-1/+1
| | | | | | | | | | | | 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: 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: 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-061-27/+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: 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
* dbwrap: Prevent transactions on non-persistent dbsVolker Lendecke2013-02-081-0/+5
| | | | | | | | | dbwrap_ctdb does not allow this anyway. This patch will avoid suprises when going non-clustered to clustered. Not everybody is developing against a clustered environment :-) Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dbwrap: add dbwrap_is_persistent()Michael Adam2013-01-151-0/+5
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* lib/dbwrap: rewrite lock order check to ease debuggingGregor Beck2012-08-031-30/+55
| | | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Aug 3 12:52:38 CEST 2012 on sn-devel-104
* dbwrap: dbwrap_hash_size().Rusty Russell2012-06-221-0/+5
| | | | | | | Implemented for ntdb and tdb; falls back to 0 for others. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* dbwrap: dbwrap_name().Rusty Russell2012-06-221-0/+5
| | | | | | | | Useful for debug messages: particularly once we start switching between .tdb and .ntdb files. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* dbwrap: dbwrap_transaction_start_nonblock().Rusty Russell2012-06-221-0/+10
| | | | | | | | Implemented for ntdb and tdb; falls back to the blocking variant for others. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* dbwrap: dbwrap_fetch_locked_timeout().Rusty Russell2012-06-221-0/+27
| | | | | | | | Implemented for ntdb and tdb; falls back to the non-timeout variant for others. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* dbwrap: add dbwrap_check() function.Rusty Russell2012-06-221-0/+21
| | | | | Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* dbwrap: remove get_flags().Rusty Russell2012-06-221-5/+0
| | | | | | | | | | | | The flags returned were TDB-specific: this was only used for detecting the endianness of obsolete databases (the conversion code was put in in 2003, with reference to Samba 2.3). It's easier to remove it than to translate the NTDB flags to TDB flags, and it's a really weird thing to ask for anyway. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* move the dbwrap library to the top levelMichael Adam2012-05-141-0/+398
Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Mon May 14 04:04:55 CEST 2012 on sn-devel-104