summaryrefslogtreecommitdiff
path: root/source3/lib/dbwrap
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-03-18 14:47:37 +0100
committerVolker Lendecke <vl@samba.org>2012-04-17 10:21:00 +0200
commitba8f19c556724aaa2de71473234f8bab1f301a7f (patch)
treee7943edc64a7565d0d64778cfe75968f4bb0da7f /source3/lib/dbwrap
parentd2fe0bf776dc17b66dcd3ff907c1ff5a43eceeb6 (diff)
downloadsamba-ba8f19c556724aaa2de71473234f8bab1f301a7f.tar.gz
samba-ba8f19c556724aaa2de71473234f8bab1f301a7f.tar.bz2
samba-ba8f19c556724aaa2de71473234f8bab1f301a7f.zip
s3: Open up 3 levels of dbwrap_lock_order
Diffstat (limited to 'source3/lib/dbwrap')
-rw-r--r--source3/lib/dbwrap/dbwrap_open.c11
-rw-r--r--source3/lib/dbwrap/dbwrap_open.h3
2 files changed, 9 insertions, 5 deletions
diff --git a/source3/lib/dbwrap/dbwrap_open.c b/source3/lib/dbwrap/dbwrap_open.c
index 9bf279b1d8..5491a1f56b 100644
--- a/source3/lib/dbwrap/dbwrap_open.c
+++ b/source3/lib/dbwrap/dbwrap_open.c
@@ -66,11 +66,14 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
const char *sockname;
#endif
- if ((lock_order != DBWRAP_LOCK_ORDER_1) &&
- (lock_order != DBWRAP_LOCK_ORDER_2)) {
+ switch (lock_order) {
+ case DBWRAP_LOCK_ORDER_1:
+ case DBWRAP_LOCK_ORDER_2:
+ case DBWRAP_LOCK_ORDER_3:
+ break;
+ default:
/*
- * Only allow 2 levels. ctdb gives us 3, and we will
- * have the watchers database soon.
+ * Only allow the 3 levels ctdb gives us.
*/
errno = EINVAL;
return NULL;
diff --git a/source3/lib/dbwrap/dbwrap_open.h b/source3/lib/dbwrap/dbwrap_open.h
index 2763ef2ade..9ed2245afd 100644
--- a/source3/lib/dbwrap/dbwrap_open.h
+++ b/source3/lib/dbwrap/dbwrap_open.h
@@ -31,7 +31,8 @@ bool db_is_local(const char *name);
enum dbwrap_lock_order {
DBWRAP_LOCK_ORDER_1 = 1,
- DBWRAP_LOCK_ORDER_2 = 2
+ DBWRAP_LOCK_ORDER_2 = 2,
+ DBWRAP_LOCK_ORDER_3 = 3
};
/**