summaryrefslogtreecommitdiff
path: root/lib/dbwrap
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2014-01-28 11:54:06 +0100
committerStefan Metzmacher <metze@samba.org>2014-02-07 16:06:07 +0100
commit5e5a31bfb2de9ffa9829db1002118773a22ac9e4 (patch)
tree7d76c59eff62075298c41a06e521b4876c2dcbe7 /lib/dbwrap
parent8dbb58285b6590203d3c510c22cb6936fd642e5f (diff)
downloadsamba-5e5a31bfb2de9ffa9829db1002118773a22ac9e4.tar.gz
dbwrap: add DBWRAP_LOCK_ORDER_VALID()
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'lib/dbwrap')
-rw-r--r--lib/dbwrap/dbwrap_private.h4
1 files changed, 4 insertions, 0 deletions
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__ */