Skip to content

Commit

Permalink
ctdb-deamon: Rename vnn_has_interface_with_name() to vnn_has_interface()
Browse files Browse the repository at this point in the history
Now takes a pointer to an interface structure and does direct pointer
comparisons.

Signed-off-by: Martin Schwenke <[email protected]>
Reviewed-by: Amitay Isaacs <[email protected]>
  • Loading branch information
martin-schwenke authored and Amitay Isaacs committed Sep 8, 2016
1 parent b129c28 commit 2f46056
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ctdb/server/ctdb_takeover.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ ctdb_add_local_iface(struct ctdb_context *ctdb, const char *iface)
return i;
}

static bool vnn_has_interface_with_name(struct ctdb_vnn *vnn,
const char *name)
static bool vnn_has_interface(struct ctdb_vnn *vnn,
const struct ctdb_interface *iface)
{
struct vnn_interface *i;

for (i = vnn->ifaces; i != NULL; i = i->next) {
if (strcmp(name, i->iface->name) == 0) {
if (iface == i->iface) {
return true;
}
}
Expand Down Expand Up @@ -177,14 +177,14 @@ static void ctdb_remove_orphaned_ifaces(struct ctdb_context *ctdb,
next = i->next;

/* Only consider interfaces named in the given VNN. */
if (!vnn_has_interface_with_name(vnn, i->name)) {
if (!vnn_has_interface(vnn, i)) {
continue;
}

/* Search for a vnn with this interface. */
found = false;
for (tv=ctdb->vnn; tv; tv=tv->next) {
if (vnn_has_interface_with_name(tv, i->name)) {
if (vnn_has_interface(tv, i)) {
found = true;
break;
}
Expand Down

0 comments on commit 2f46056

Please sign in to comment.