From: Ronnie Sahlberg Date: Thu, 7 Oct 2010 05:18:27 +0000 (+1100) Subject: get rid of the "ctdb setflags" command since X-Git-Url: http://git.samba.org/?p=metze%2Fctdb%2Fwip.git;a=commitdiff_plain;h=25f96db966230e90291eee57841c9faaae33713b get rid of the "ctdb setflags" command since 1, we dont need it 2, it uses the ugly "modify flags" control that should die --- diff --git a/tools/ctdb.c b/tools/ctdb.c index ff2e7e98..8d422552 100644 --- a/tools/ctdb.c +++ b/tools/ctdb.c @@ -4461,50 +4461,6 @@ static int control_wipedb(struct ctdb_context *ctdb, int argc, return 0; } -/* - * set flags of a node in the nodemap - */ -static int control_setflags(struct ctdb_context *ctdb, int argc, const char **argv) -{ - int ret; - int32_t status; - int node; - int flags; - TDB_DATA data; - struct ctdb_node_flag_change c; - - if (argc != 2) { - usage(); - return -1; - } - - if (sscanf(argv[0], "%d", &node) != 1) { - DEBUG(DEBUG_ERR, ("Badly formed node\n")); - usage(); - return -1; - } - if (sscanf(argv[1], "0x%x", &flags) != 1) { - DEBUG(DEBUG_ERR, ("Badly formed flags\n")); - usage(); - return -1; - } - - c.pnn = node; - c.old_flags = 0; - c.new_flags = flags; - - data.dsize = sizeof(c); - data.dptr = (unsigned char *)&c; - - ret = ctdb_control(ctdb, options.pnn, 0, CTDB_CONTROL_MODIFY_FLAGS, 0, - data, NULL, NULL, &status, NULL, NULL); - if (ret != 0 || status != 0) { - DEBUG(DEBUG_ERR,("Failed to modify flags\n")); - return -1; - } - return 0; -} - /* dump memory usage */ @@ -4803,7 +4759,6 @@ static const struct { { "dumpdbbackup", control_dumpdbbackup, false, true, "dump database backup from a file.", ""}, { "wipedb", control_wipedb, false, false, "wipe the contents of a database.", ""}, { "recmaster", control_recmaster, false, false, "show the pnn for the recovery master."}, - { "setflags", control_setflags, false, false, "set flags for a node in the nodemap.", " "}, { "scriptstatus", control_scriptstatus, false, false, "show the status of the monitoring scripts (or all scripts)", "[all]"}, { "enablescript", control_enablescript, false, false, "enable an eventscript", "