From ba8f19c556724aaa2de71473234f8bab1f301a7f Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 18 Mar 2012 14:47:37 +0100 Subject: s3: Open up 3 levels of dbwrap_lock_order --- source3/lib/dbwrap/dbwrap_open.c | 11 +++++++---- source3/lib/dbwrap/dbwrap_open.h | 3 ++- 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 }; /** -- cgit