ctdb-tools: Remove unused struct pnn_node and function read_pnn_node_file()
authorMartin Schwenke <martin@meltin.net>
Tue, 24 Feb 2015 00:18:34 +0000 (11:18 +1100)
committerAmitay Isaacs <amitay@samba.org>
Mon, 23 Mar 2015 11:23:12 +0000 (12:23 +0100)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tools/ctdb.c

index b975e87beb4c91363fa314c2a7228968c0b52c48..23cfc9d977f33ccd733dcc86404c31df3c13ffb9 100644 (file)
@@ -849,57 +849,6 @@ static int control_pnn(struct ctdb_context *ctdb, int argc, const char **argv)
 }
 
 
-struct pnn_node {
-       struct pnn_node *next, *prev;
-       ctdb_sock_addr addr;
-       int pnn;
-};
-
-static struct pnn_node *read_pnn_node_file(TALLOC_CTX *mem_ctx,
-                                          const char *file)
-{
-       int nlines;
-       char **lines;
-       int i, pnn;
-       struct pnn_node *pnn_nodes = NULL;
-       struct pnn_node *pnn_node;
-
-       lines = file_lines_load(file, &nlines, 0, mem_ctx);
-       if (lines == NULL) {
-               return NULL;
-       }
-       for (i=0, pnn=0; i<nlines; i++) {
-               char *node;
-
-               node = lines[i];
-               /* strip leading spaces */
-               while((*node == ' ') || (*node == '\t')) {
-                       node++;
-               }
-               if (*node == '#') {
-                       pnn++;
-                       continue;
-               }
-               if (strcmp(node, "") == 0) {
-                       continue;
-               }
-               pnn_node = talloc(mem_ctx, struct pnn_node);
-               pnn_node->pnn = pnn++;
-
-               if (!parse_ip(node, NULL, 0, &pnn_node->addr)) {
-                       DEBUG(DEBUG_ERR,
-                             ("Invalid IP address '%s' in file %s\n",
-                              node, file));
-                       /* Caller will free mem_ctx */
-                       return NULL;
-               }
-
-               DLIST_ADD_END(pnn_nodes, pnn_node, NULL);
-       }
-
-       return pnn_nodes;
-}
-
 static struct ctdb_node_map *read_nodes_file(TALLOC_CTX *mem_ctx)
 {
        const char *nodes_list;