From e83ec8a65d0ef1a565ca66fa70d146b12ba1402a Mon Sep 17 00:00:00 2001 From: Jeff Darcy Date: Thu, 27 Jul 2017 09:03:40 -0700 Subject: glusterd: fix misleadingly named GF_FOR_EACH_ENTRY_IN_DIR What it really does is skip irrelevant entries like . and .. until we're at an entry we might actually care about. Renamed to GF_SKIP_IRRELEVANT_ENTRIES accordingly. Change-Id: If0464451a8243c29c0a93b4c6f0f0eda2fade44c Signed-off-by: Jeff Darcy Reviewed-on: https://review.gluster.org/17901 Reviewed-by: Niels de Vos Smoke: Gluster Build System Tested-by: Jeff Darcy CentOS-regression: Gluster Build System Reviewed-by: Atin Mukherjee --- xlators/mgmt/glusterd/src/glusterd-store.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-store.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c index 4b80186fb70..ea73a1f6d6b 100644 --- a/xlators/mgmt/glusterd/src/glusterd-store.c +++ b/xlators/mgmt/glusterd/src/glusterd-store.c @@ -661,7 +661,7 @@ glusterd_store_remove_bricks (glusterd_volinfo_t *volinfo, char *delete_path) dir = sys_opendir (brickdir); - GF_FOR_EACH_ENTRY_IN_DIR (entry, dir, scratch); + GF_SKIP_IRRELEVANT_ENTRIES (entry, dir, scratch); while (entry) { snprintf (path, sizeof (path), "%s/%s", @@ -671,7 +671,7 @@ glusterd_store_remove_bricks (glusterd_volinfo_t *volinfo, char *delete_path) gf_msg_debug (this->name, 0, "Unable to unlink %s", path); } - GF_FOR_EACH_ENTRY_IN_DIR (entry, dir, scratch); + GF_SKIP_IRRELEVANT_ENTRIES (entry, dir, scratch); } sys_closedir (dir); @@ -1924,7 +1924,7 @@ glusterd_store_delete_snap (glusterd_snap_t *snap) goto out; } - GF_FOR_EACH_ENTRY_IN_DIR (entry, dir, scratch); + GF_SKIP_IRRELEVANT_ENTRIES (entry, dir, scratch); while (entry) { snprintf (path, PATH_MAX, "%s/%s", delete_path, entry->d_name); ret = sys_stat (path, &st); @@ -1949,7 +1949,7 @@ glusterd_store_delete_snap (glusterd_snap_t *snap) entry->d_name); stat_failed: memset (path, 0, sizeof(path)); - GF_FOR_EACH_ENTRY_IN_DIR (entry, dir, scratch); + GF_SKIP_IRRELEVANT_ENTRIES (entry, dir, scratch); } ret = sys_closedir (dir); @@ -3293,7 +3293,7 @@ glusterd_store_retrieve_volumes (xlator_t *this, glusterd_snap_t *snap) goto out; } - GF_FOR_EACH_ENTRY_IN_DIR (entry, dir, scratch); + GF_SKIP_IRRELEVANT_ENTRIES (entry, dir, scratch); while (entry) { if (snap && ((!strcmp (entry->d_name, "geo-replication")) || @@ -3337,7 +3337,7 @@ glusterd_store_retrieve_volumes (xlator_t *this, glusterd_snap_t *snap) } next: - GF_FOR_EACH_ENTRY_IN_DIR (entry, dir, scratch); + GF_SKIP_IRRELEVANT_ENTRIES (entry, dir, scratch); } ret = 0; @@ -3880,7 +3880,7 @@ glusterd_store_retrieve_snaps (xlator_t *this) goto out; } - GF_FOR_EACH_ENTRY_IN_DIR (entry, dir, scratch); + GF_SKIP_IRRELEVANT_ENTRIES (entry, dir, scratch); while (entry) { if (strcmp (entry->d_name, GLUSTERD_MISSED_SNAPS_LIST_FILE)) { @@ -3893,7 +3893,7 @@ glusterd_store_retrieve_snaps (xlator_t *this) goto out; } } - GF_FOR_EACH_ENTRY_IN_DIR (entry, dir, scratch); + GF_SKIP_IRRELEVANT_ENTRIES (entry, dir, scratch); } /* Retrieve missed_snaps_list */ @@ -4322,7 +4322,7 @@ glusterd_store_retrieve_peers (xlator_t *this) } for (;;) { - GF_FOR_EACH_ENTRY_IN_DIR (entry, dir, scratch); + GF_SKIP_IRRELEVANT_ENTRIES (entry, dir, scratch); if (!entry) { break; } -- cgit