locking: Remove functions that are not used anymore
authorAmitay Isaacs <amitay@gmail.com>
Wed, 8 May 2013 00:42:08 +0000 (10:42 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Thu, 23 May 2013 23:06:40 +0000 (09:06 +1000)
These functions were used in locking child process to do the locking.  With
locking helper, these are not required.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
include/ctdb_private.h
server/ctdb_lock.c

index 813a5a661c258c63b9de400947e5e57a6972a071..c47210e1f0a9110e88f05fad432eab61acc8b486 100644 (file)
@@ -1564,8 +1564,6 @@ int ctdb_start_monitoring_interfaces(struct ctdb_context *ctdb);
 /* from server/ctdb_lock.c */
 struct lock_request;
 
-int ctdb_lockall_prio(struct ctdb_context *ctdb, uint32_t priority);
-int ctdb_unlockall_prio(struct ctdb_context *ctdb, uint32_t priority);
 int ctdb_lockall_mark_prio(struct ctdb_context *ctdb, uint32_t priority);
 int ctdb_lockall_unmark_prio(struct ctdb_context *ctdb, uint32_t priority);
 
index d21d00f8c4517693dcb4465c7322fbc0b094597f..d2482282aa456b77160da60322eb0c40b61266d9 100644 (file)
@@ -155,90 +155,6 @@ static int ctdb_db_iterator(struct ctdb_context *ctdb, uint32_t priority,
 }
 
 
-/*
- * lock all databases
- */
-static int db_lock_handler(struct ctdb_db_context *ctdb_db, uint32_t priority,
-                          void *private_data)
-{
-       if (priority == 0) {
-               DEBUG(DEBUG_INFO, ("locking database %s\n",
-                                  ctdb_db->db_name));
-       } else {
-               DEBUG(DEBUG_INFO, ("locking database %s, priority:%u\n",
-                                  ctdb_db->db_name, priority));
-       }
-
-       if (tdb_lockall(ctdb_db->ltdb->tdb) != 0) {
-               DEBUG(DEBUG_ERR, ("Failed to lock database %s\n",
-                                 ctdb_db->db_name));
-               return -1;
-       }
-
-       return 0;
-}
-
-int ctdb_lockall_prio(struct ctdb_context *ctdb, uint32_t priority)
-{
-       return ctdb_db_iterator(ctdb, priority, db_lock_handler, NULL);
-}
-
-static int ctdb_lockall(struct ctdb_context *ctdb)
-{
-       uint32_t priority;
-
-       for (priority=1; priority<=NUM_DB_PRIORITIES; priority++) {
-               if (ctdb_db_iterator(ctdb, priority, db_lock_handler, NULL) != 0) {
-                       return -1;
-               }
-       }
-
-       return 0;
-}
-
-
-/*
- * unlock all databases
- */
-static int db_unlock_handler(struct ctdb_db_context *ctdb_db, uint32_t priority,
-                            void *private_data)
-{
-       if (priority == 0) {
-               DEBUG(DEBUG_INFO, ("unlocking database %s\n",
-                                  ctdb_db->db_name));
-       } else {
-               DEBUG(DEBUG_INFO, ("unlocking database %s, priority:%u\n",
-                                  ctdb_db->db_name, priority));
-       }
-
-       if (tdb_unlockall(ctdb_db->ltdb->tdb) != 0) {
-               DEBUG(DEBUG_ERR, ("Failed to unlock database %s\n",
-                                 ctdb_db->db_name));
-               return -1;
-       }
-
-       return 0;
-}
-
-int ctdb_unlockall_prio(struct ctdb_context *ctdb, uint32_t priority)
-{
-       return ctdb_db_iterator(ctdb, priority, db_unlock_handler, NULL);
-}
-
-static int ctdb_unlockall(struct ctdb_context *ctdb)
-{
-       uint32_t priority;
-
-       for (priority=NUM_DB_PRIORITIES; priority>=0; priority--) {
-               if (ctdb_db_iterator(ctdb, priority, db_unlock_handler, NULL) != 0) {
-                       return -1;
-               }
-       }
-
-       return 0;
-}
-
-
 /*
  * lock all databases - mark only
  */