[sheepdog] [PATCH] trivial: misc fixes of comments

Hitoshi Mitake mitake.hitoshi at gmail.com
Tue May 7 18:00:10 CEST 2013


This patch fixes some incorrect comments:
1. group.c: colosync -> corosync
2. sockfd_cache.c: vnode -> node
3. sheep_priv.h: past -> part
4. group.c: the comment of leave_cluster()

1 is a very trivial mistake. 2 wouldn't cause a serious confusion but
the description is not correct. vnode is a concept of consisntent
hashing and it is not a something connect to. 3 would be
confusing. Because the way of dealing with exceptional nodes is subtle
and hard to understand. 4 is the most serious misleading comment. IIUC,
current sheep doesn't have a way of becoming a gateway node even if it
faces EIO.

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

diff --git a/sheep/group.c b/sheep/group.c
index bb5d703..e4ee3cd 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -980,7 +980,7 @@ enum cluster_join_result sd_check_join_cb(const struct sd_node *joining,
 		uint32_t epoch;
 
 		/*
-		 * If I'm the first sheep joins in colosync, I
+		 * If I'm the first sheep joins in corosync, I
 		 * becomes the master without sending JOIN.
 		 */
 
@@ -1287,11 +1287,7 @@ int create_cluster(int port, int64_t zone, int nr_vnodes,
 	return 0;
 }
 
-/*
- * We will call this function for two reason:
- * 1) make this node working as a gateway, or
- * 2) the program is going to shutdown itself.
- */
+/* We will call this function when sheep is going to shutdown itself. */
 int leave_cluster(void)
 {
 	static bool left;
diff --git a/sheep/sheep_priv.h b/sheep/sheep_priv.h
index d01d408..ba79bd2 100644
--- a/sheep/sheep_priv.h
+++ b/sheep/sheep_priv.h
@@ -77,7 +77,7 @@ struct cluster_info {
 	uint64_t disk_space;
 
 	/*
-	 * List of nodes that were past of the last epoch before a shutdown,
+	 * List of nodes that were part of the last epoch before a shutdown,
 	 * but failed to join.
 	 */
 	struct list_head failed_nodes;
diff --git a/sheep/sockfd_cache.c b/sheep/sockfd_cache.c
index 1b9644f..9712836 100644
--- a/sheep/sockfd_cache.c
+++ b/sheep/sockfd_cache.c
@@ -388,7 +388,7 @@ grab:
 		goto out;
 	}
 
-	/* Create a new cached connection for this vnode */
+	/* Create a new cached connection for this node */
 	sd_dprintf("create cache connection %s:%d idx %d", name, port, idx);
 	fd = connect_to(name, port);
 	if (fd < 0) {
@@ -450,7 +450,7 @@ static void sockfd_cache_close(const struct node_id *nid, int idx)
 }
 
 /*
- * Return a sockfd connected to the vnode to the caller
+ * Return a sockfd connected to the node to the caller
  *
  * Try to get a 'long' FD as best, which is cached and never closed. If no FD
  * available, we return a 'short' FD which is supposed to be closed by
@@ -480,7 +480,7 @@ struct sockfd *sheep_get_sockfd(const struct node_id *nid)
 }
 
 /*
- * Rlease a sockfd connected to the vnode, which is acquired from
+ * Rlease a sockfd connected to the node, which is acquired from
  * sheep_get_sockfd()
  *
  * If it is a long FD, just decrease the refcount to make it available again.
@@ -504,10 +504,10 @@ void sheep_put_sockfd(const struct node_id *nid, struct sockfd *sfd)
 }
 
 /*
- * Delete a sockfd connected to the vnode, when vnode is crashed.
+ * Delete a sockfd connected to the node, when node is crashed.
  *
  * If it is a long FD, de-refcount it and tres to destroy all the cached FDs of
- * this vnode in the cache.
+ * this node in the cache.
  * If it is a short FD, just close it.
  */
 void sheep_del_sockfd(const struct node_id *nid, struct sockfd *sfd)
-- 
1.7.5.1




More information about the sheepdog mailing list