summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-store.c
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@fb.com>2017-07-27 09:03:40 -0700
committerAtin Mukherjee <amukherj@redhat.com>2017-07-31 04:44:20 +0000
commite83ec8a65d0ef1a565ca66fa70d146b12ba1402a (patch)
treeb7e6d4582a2bdc3f3ed41e47b345742338f70949 /xlators/mgmt/glusterd/src/glusterd-store.c
parent1bc3cd9bd59e3826fd14fc239322f039d7a814da (diff)
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 <jdarcy@fb.com> Reviewed-on: https://review.gluster.org/17901 Reviewed-by: Niels de Vos <ndevos@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> Tested-by: Jeff Darcy <jeff@pl.atyp.us> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-store.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-store.c18
1 files changed, 9 insertions, 9 deletions
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;
}