summaryrefslogtreecommitdiff
path: root/source3/include/locking.h
diff options
context:
space:
mode:
Diffstat (limited to 'source3/include/locking.h')
-rw-r--r--source3/include/locking.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/source3/include/locking.h b/source3/include/locking.h
index 9e70411fa6..a09e7d1aff 100644
--- a/source3/include/locking.h
+++ b/source3/include/locking.h
@@ -23,11 +23,15 @@
#define _LOCKING_H
/* passed to br lock code - the UNLOCK_LOCK should never be stored into the tdb
- and is used in calculating POSIX unlock ranges only. */
+ and is used in calculating POSIX unlock ranges only. We differentiate between
+ PENDING read and write locks to allow posix lock downgrades to trigger a lock
+ re-evaluation. */
-enum brl_type {READ_LOCK, WRITE_LOCK, PENDING_LOCK, UNLOCK_LOCK};
+enum brl_type {READ_LOCK, WRITE_LOCK, PENDING_READ_LOCK, PENDING_WRITE_LOCK, UNLOCK_LOCK};
enum brl_flavour {WINDOWS_LOCK = 0, POSIX_LOCK = 1};
+#define IS_PENDING_LOCK(type) ((type) == PENDING_READ_LOCK || (type) == PENDING_WRITE_LOCK)
+
/* This contains elements that differentiate locks. The smbpid is a
client supplied pid, and is essentially the locking context for
this client */