[SCM] Samba Shared Repository - branch master updated

Michael Adam obnox at samba.org
Mon Mar 31 19:00:05 MDT 2014


The branch, master has been updated
       via  6cdde27 ctdb:daemon avoid goto ctdb_remove_orphaned_ifaces()
       via  dd56afc ctdb:daemon take a shortcut in all_nodes_are_disabled()
      from  d550acf rpcclient: abort shadow-copy set on commit failure

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 6cdde2711b5b4ad09f9703b2558db7c5d90e9a35
Author: Gregor Beck <gbeck at sernet.de>
Date:   Mon Mar 31 08:04:21 2014 +0200

    ctdb:daemon avoid goto ctdb_remove_orphaned_ifaces()
    
    Signed-off-by: Gregor Beck <gbeck at sernet.de>
    Reviewed-by: David Disseldorp <ddiss at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    
    Autobuild-User(master): Michael Adam <obnox at samba.org>
    Autobuild-Date(master): Tue Apr  1 02:59:05 CEST 2014 on sn-devel-104

commit dd56afc7df1149e809486bc0f1c336a42bc7c0aa
Author: Gregor Beck <gbeck at sernet.de>
Date:   Mon Mar 31 07:50:45 2014 +0200

    ctdb:daemon take a shortcut in all_nodes_are_disabled()
    
    Signed-off-by: Gregor Beck <gbeck at sernet.de>
    Reviewed-by: David Disseldorp <ddiss at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 ctdb/server/ctdb_takeover.c |   23 +++++++++--------------
 1 files changed, 9 insertions(+), 14 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/server/ctdb_takeover.c b/ctdb/server/ctdb_takeover.c
index bbb0226..1404954 100644
--- a/ctdb/server/ctdb_takeover.c
+++ b/ctdb/server/ctdb_takeover.c
@@ -120,18 +120,17 @@ static bool vnn_has_interface_with_name(struct ctdb_vnn *vnn,
 static void ctdb_remove_orphaned_ifaces(struct ctdb_context *ctdb,
 					struct ctdb_vnn *vnn)
 {
-	struct ctdb_iface *i;
+	struct ctdb_iface *i, *next;
 
 	/* For each interface, check if there's an IP using it. */
-	i = ctdb->ifaces;
-	while (i != NULL) {
+	for (i = ctdb->ifaces; i != NULL; i = next) {
 		struct ctdb_vnn *tv;
 		bool found;
-		struct ctdb_iface *next = i->next;
+		next = i->next;
 
 		/* Only consider interfaces named in the given VNN. */
 		if (!vnn_has_interface_with_name(vnn, i->name)) {
-			goto next;
+			continue;
 		}
 
 		/* Is the "single IP" on this interface? */
@@ -139,7 +138,7 @@ static void ctdb_remove_orphaned_ifaces(struct ctdb_context *ctdb,
 		    (ctdb->single_ip_vnn->ifaces[0] != NULL) &&
 		    (strcmp(i->name, ctdb->single_ip_vnn->ifaces[0]) == 0)) {
 			/* Found, next interface please... */
-			goto next;
+			continue;
 		}
 		/* Search for a vnn with this interface. */
 		found = false;
@@ -155,9 +154,6 @@ static void ctdb_remove_orphaned_ifaces(struct ctdb_context *ctdb,
 			DLIST_REMOVE(ctdb->ifaces, i);
 			talloc_free(i);
 		}
-
-	next:
-		i = next;
 	}
 }
 
@@ -2204,17 +2200,16 @@ finished:
 
 static bool all_nodes_are_disabled(struct ctdb_node_map *nodemap)
 {
-	int i, num_healthy;
+	int i;
 
-	/* Count how many completely healthy nodes we have */
-	num_healthy = 0;
 	for (i=0;i<nodemap->num;i++) {
 		if (!(nodemap->nodes[i].flags & (NODE_FLAGS_INACTIVE|NODE_FLAGS_DISABLED))) {
-			num_healthy++;
+			/* Found one completely healthy node */
+			return false;
 		}
 	}
 
-	return num_healthy == 0;
+	return true;
 }
 
 /* The calculation part of the IP allocation algorithm. */


-- 
Samba Shared Repository


More information about the samba-cvs mailing list