From 5e5a31bfb2de9ffa9829db1002118773a22ac9e4 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 28 Jan 2014 11:54:06 +0100 Subject: [PATCH] dbwrap: add DBWRAP_LOCK_ORDER_VALID() Signed-off-by: Michael Adam Reviewed-by: Stefan Metzmacher --- lib/dbwrap/dbwrap_private.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/dbwrap/dbwrap_private.h b/lib/dbwrap/dbwrap_private.h index e1316543212..a6bad04971b 100644 --- a/lib/dbwrap/dbwrap_private.h +++ b/lib/dbwrap/dbwrap_private.h @@ -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__ */ -- 2.11.4.GIT