From 3aa96c3a3eb87fc6a1ad94c983e363b402b48ff5 Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Tue, 15 Jul 2014 12:59:57 +1000 Subject: [PATCH] ctdb-locking: Remove unused variable lock_num_pending The number of pending locks displayed in ctdb statistics are stored in ctdb_statistics structure and not ctdb_context. Signed-off-by: Amitay Isaacs Reviewed-by: Volker Lendecke --- ctdb/include/ctdb_private.h | 1 - ctdb/server/ctdb_lock.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h index 459e96d4ea0..68d45a3afec 100644 --- a/ctdb/include/ctdb_private.h +++ b/ctdb/include/ctdb_private.h @@ -558,7 +558,6 @@ struct ctdb_context { struct trbt_tree *child_processes; /* Used for locking record/db/alldb */ - int lock_num_pending; struct lock_context *lock_current; struct lock_context *lock_pending; }; diff --git a/ctdb/server/ctdb_lock.c b/ctdb/server/ctdb_lock.c index 3de85188b50..b9740857c1d 100644 --- a/ctdb/server/ctdb_lock.c +++ b/ctdb/server/ctdb_lock.c @@ -284,7 +284,6 @@ static int ctdb_lock_context_destructor(struct lock_context *lock_ctx) } } else { DLIST_REMOVE(lock_ctx->ctdb->lock_pending, lock_ctx); - lock_ctx->ctdb->lock_num_pending--; CTDB_DECREMENT_STAT(lock_ctx->ctdb, locks.num_pending); if (lock_ctx->type == LOCK_RECORD || lock_ctx->type == LOCK_DB) { CTDB_DECREMENT_DB_STAT(lock_ctx->ctdb_db, locks.num_pending); @@ -689,7 +688,6 @@ static void ctdb_lock_schedule(struct ctdb_context *ctdb) if (! lock_ctx->request) { DEBUG(DEBUG_INFO, ("Removing lock context without lock request\n")); DLIST_REMOVE(ctdb->lock_pending, lock_ctx); - ctdb->lock_num_pending--; CTDB_DECREMENT_STAT(ctdb, locks.num_pending); if (lock_ctx->ctdb_db) { CTDB_DECREMENT_DB_STAT(lock_ctx->ctdb_db, locks.num_pending); @@ -799,7 +797,6 @@ static void ctdb_lock_schedule(struct ctdb_context *ctdb) /* Move the context from pending to current */ DLIST_REMOVE(ctdb->lock_pending, lock_ctx); - ctdb->lock_num_pending--; DLIST_ADD_END(ctdb->lock_current, lock_ctx, NULL); if (lock_ctx->ctdb_db) { lock_ctx->ctdb_db->lock_num_current++; @@ -862,7 +859,6 @@ static struct lock_request *ctdb_lock_internal(struct ctdb_context *ctdb, lock_ctx->child = -1; DLIST_ADD_END(ctdb->lock_pending, lock_ctx, NULL); - ctdb->lock_num_pending++; CTDB_INCREMENT_STAT(ctdb, locks.num_pending); if (ctdb_db) { CTDB_INCREMENT_DB_STAT(ctdb_db, locks.num_pending); -- 2.34.1