[sheepdog] [PATCH 2/2] sheep: use node_is_local() instead of is_myself()

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Fri Sep 7 10:55:02 CEST 2012


node_is_local() is added to sheep_priv.h, using it instead of
is_myself() is a little bit better

Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
---
 sheep/group.c |    4 ++--
 sheep/store.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sheep/group.c b/sheep/group.c
index 23011ab..d229d17 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -624,7 +624,7 @@ static int get_vdis_from(struct sd_node *node)
 	char host[128];
 	int count;
 
-	if (is_myself(node->nid.addr, node->nid.port))
+	if (node_is_local(node))
 		goto out;
 
 	addr_to_str(host, sizeof(host), node->nid.addr, 0);
@@ -925,7 +925,7 @@ void sd_notify_handler(struct sd_node *sender, void *data, size_t data_len)
 	dprintf("op %s, size: %zd, from: %s\n",
 		op_name(op), data_len, node_to_str(sender));
 
-	if (is_myself(sender->nid.addr, sender->nid.port)) {
+	if (node_is_local(sender)) {
 		if (has_process_work(op))
 			req = list_first_entry(&sys->pending_block_list,
 					       struct request, pending_list);
diff --git a/sheep/store.c b/sheep/store.c
index 56a1d5a..74fd931 100644
--- a/sheep/store.c
+++ b/sheep/store.c
@@ -106,7 +106,7 @@ int epoch_log_read_remote(uint32_t epoch, struct sd_node *nodes, int len)
 		unsigned int rlen, wlen;
 		int fd;
 
-		if (is_myself(local_nodes[i].nid.addr, local_nodes[i].nid.port))
+		if (node_is_local(&local_nodes[i]))
 			continue;
 
 		addr_to_str(host, sizeof(host), local_nodes[i].nid.addr, 0);
-- 
1.7.2.5




More information about the sheepdog mailing list