summaryrefslogtreecommitdiff
path: root/ctdb/server/ctdb_lock.c
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2014-08-21 12:32:02 +1000
committerAmitay Isaacs <amitay@samba.org>2015-10-07 14:53:26 +0200
commit8c58c7392fe342fb39fcaf81c2465762f1823b51 (patch)
tree05291da16a54d164293cad1ee13c989e74dbd57a /ctdb/server/ctdb_lock.c
parent056c44fda3f3d84dc3eb9766e0ee04bdb6387ea5 (diff)
downloadsamba-8c58c7392fe342fb39fcaf81c2465762f1823b51.tar.gz
ctdb-daemon: Avoid the use of ctdb->freeze_mode variable
Use ctdb->freeze_mode only in ctdb_freeze.c and use the functions to check if databases are frozen everywhere else. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'ctdb/server/ctdb_lock.c')
-rw-r--r--ctdb/server/ctdb_lock.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/ctdb/server/ctdb_lock.c b/ctdb/server/ctdb_lock.c
index 2ef5b214646..9494f9f14f3 100644
--- a/ctdb/server/ctdb_lock.c
+++ b/ctdb/server/ctdb_lock.c
@@ -196,11 +196,10 @@ int ctdb_lockall_mark_prio(struct ctdb_context *ctdb, uint32_t priority)
/*
* This function is only used by the main dameon during recovery.
* At this stage, the databases have already been locked, by a
- * dedicated child process. The freeze_mode variable is used to track
- * whether the actual locks are held by the child process or not.
+ * dedicated child process.
*/
- if (ctdb->freeze_mode[priority] != CTDB_FREEZE_FROZEN) {
+ if (!ctdb_db_prio_frozen(ctdb, priority)) {
DEBUG(DEBUG_ERR, ("Attempt to mark all databases locked when not frozen\n"));
return -1;
}
@@ -256,11 +255,10 @@ int ctdb_lockall_unmark_prio(struct ctdb_context *ctdb, uint32_t priority)
/*
* This function is only used by the main daemon during recovery.
* At this stage, the databases have already been locked, by a
- * dedicated child process. The freeze_mode variable is used to track
- * whether the actual locks are held by the child process or not.
+ * dedicated child process.
*/
- if (ctdb->freeze_mode[priority] != CTDB_FREEZE_FROZEN) {
+ if (!ctdb_db_prio_frozen(ctdb, priority)) {
DEBUG(DEBUG_ERR, ("Attempt to unmark all databases locked when not frozen\n"));
return -1;
}