s3: Open up 3 levels of dbwrap_lock_order
authorVolker Lendecke <vl@samba.org>
Sun, 18 Mar 2012 13:47:37 +0000 (14:47 +0100)
committerVolker Lendecke <vl@samba.org>
Tue, 17 Apr 2012 08:21:00 +0000 (10:21 +0200)
source3/lib/dbwrap/dbwrap_open.c
source3/lib/dbwrap/dbwrap_open.h

index 9bf279b1d822622e1afa51777bdb702a186a3d6d..5491a1f56bd9b8b3865c136b43fe7c8435397b58 100644 (file)
@@ -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;
index 2763ef2adeb6ac6fb4475103e99adf5465657a70..9ed2245afd6386f8ac117d0786dd3f9cf161a5ba 100644 (file)
@@ -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
 };
 
 /**