dbwrap: add DBWRAP_LOCK_ORDER_VALID()
authorMichael Adam <obnox@samba.org>
Tue, 28 Jan 2014 10:54:06 +0000 (11:54 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 7 Feb 2014 15:06:07 +0000 (16:06 +0100)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
lib/dbwrap/dbwrap_private.h

index e131654321225f53afa6f883555ae9de114659b5..a6bad04971b7729d7b3b523174a906642a8d68ee 100644 (file)
@@ -72,5 +72,9 @@ struct db_context {
 #define DBWRAP_LOCK_ORDER_MIN DBWRAP_LOCK_ORDER_1
 #define DBWRAP_LOCK_ORDER_MAX DBWRAP_LOCK_ORDER_3
 
+#define DBWRAP_LOCK_ORDER_VALID(order) \
+       (((order) >= DBWRAP_LOCK_ORDER_MIN) && \
+        ((order) <= DBWRAP_LOCK_ORDER_MAX))
+
 #endif /* __DBWRAP_PRIVATE_H__ */