diff options
author | Amitay Isaacs <amitay@gmail.com> | 2014-07-15 14:49:44 +1000 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2014-08-04 17:59:52 +0200 |
commit | a890e760bbcb2d0f384aff285d1282de2a42d313 (patch) | |
tree | 19c269800860310869db131e7a96da35fd0fa3ea /ctdb | |
parent | aa1ff305f9bdd97675ceb4ce2b18f4cd623b8a38 (diff) | |
download | samba-a890e760bbcb2d0f384aff285d1282de2a42d313.tar.gz samba-a890e760bbcb2d0f384aff285d1282de2a42d313.tar.xz samba-a890e760bbcb2d0f384aff285d1282de2a42d313.zip |
ctdb-locking: Simplify check for locks on record or database
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'ctdb')
-rw-r--r-- | ctdb/server/ctdb_lock.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ctdb/server/ctdb_lock.c b/ctdb/server/ctdb_lock.c index 123b1dcde0..174779d66c 100644 --- a/ctdb/server/ctdb_lock.c +++ b/ctdb/server/ctdb_lock.c @@ -279,13 +279,13 @@ static int ctdb_lock_context_destructor(struct lock_context *lock_ctx) lock_ctx->ctdb_db->lock_num_current--; } CTDB_DECREMENT_STAT(lock_ctx->ctdb, locks.num_current); - if (lock_ctx->type == LOCK_RECORD || lock_ctx->type == LOCK_DB) { + if (lock_ctx->ctdb_db) { CTDB_DECREMENT_DB_STAT(lock_ctx->ctdb_db, locks.num_current); } } else { DLIST_REMOVE(lock_ctx->ctdb->lock_pending, lock_ctx); CTDB_DECREMENT_STAT(lock_ctx->ctdb, locks.num_pending); - if (lock_ctx->type == LOCK_RECORD || lock_ctx->type == LOCK_DB) { + if (lock_ctx->ctdb_db) { CTDB_DECREMENT_DB_STAT(lock_ctx->ctdb_db, locks.num_pending); } } @@ -491,7 +491,7 @@ static void ctdb_lock_timeout_handler(struct tevent_context *ev, lock_ctx = talloc_get_type_abort(private_data, struct lock_context); ctdb = lock_ctx->ctdb; - if (lock_ctx->type == LOCK_RECORD || lock_ctx->type == LOCK_DB) { + if (lock_ctx->ctdb_db) { DEBUG(DEBUG_WARNING, ("Unable to get %s lock on database %s for %.0lf seconds\n", (lock_ctx->type == LOCK_RECORD ? "RECORD" : "DB"), |