]> git.samba.org - kamenim/samba-autobuild/.git/commitdiff
ctdb-locking: Remove unused function find_lock_context()
authorAmitay Isaacs <amitay@gmail.com>
Tue, 15 Jul 2014 04:44:55 +0000 (14:44 +1000)
committerVolker Lendecke <vl@samba.org>
Mon, 4 Aug 2014 15:59:52 +0000 (17:59 +0200)
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
ctdb/server/ctdb_lock.c

index ee9c0c15fa5f165edb52ee42b3fbdd0d45fc8897..c07ccd68f2182608d12d52447521d9258ff98182 100644 (file)
@@ -656,59 +656,6 @@ static char **lock_helper_args(TALLOC_CTX *mem_ctx, struct lock_context *lock_ct
 }
 
 
-/*
- * Find the lock context of a given type
- */
-static struct lock_context *find_lock_context(struct lock_context *lock_list,
-                                             struct ctdb_db_context *ctdb_db,
-                                             TDB_DATA key,
-                                             uint32_t priority,
-                                             enum lock_type type,
-                                             uint32_t key_hash)
-{
-       struct lock_context *lock_ctx;
-
-       /* Search active locks */
-       for (lock_ctx=lock_list; lock_ctx; lock_ctx=lock_ctx->next) {
-               if (lock_ctx->type != type) {
-                       continue;
-               }
-
-               switch (lock_ctx->type) {
-               case LOCK_RECORD:
-                       if (ctdb_db == lock_ctx->ctdb_db &&
-                           key_hash == lock_ctx->key_hash) {
-                               goto done;
-                       }
-                       break;
-
-               case LOCK_DB:
-                       if (ctdb_db == lock_ctx->ctdb_db) {
-                               goto done;
-                       }
-                       break;
-
-               case LOCK_ALLDB_PRIO:
-                       if (priority == lock_ctx->priority) {
-                               goto done;
-                       }
-                       break;
-
-               case LOCK_ALLDB:
-                       goto done;
-                       break;
-               }
-       }
-
-       /* Did not find the lock context we are searching for */
-       lock_ctx = NULL;
-
-done:
-       return lock_ctx;
-
-}
-
-
 /*
  * Schedule a new lock child process
  * Set up callback handler and timeout handler