diff options
author | Jeff Darcy <jdarcy@fb.com> | 2017-07-27 09:03:40 -0700 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2017-07-31 04:44:20 +0000 |
commit | e83ec8a65d0ef1a565ca66fa70d146b12ba1402a (patch) | |
tree | b7e6d4582a2bdc3f3ed41e47b345742338f70949 /xlators/mgmt/glusterd/src | |
parent | 1bc3cd9bd59e3826fd14fc239322f039d7a814da (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')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-hooks.c | 4 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-quota.c | 4 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-store.c | 18 |
3 files changed, 13 insertions, 13 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-hooks.c b/xlators/mgmt/glusterd/src/glusterd-hooks.c index 7519ca2faae..fa88b667c14 100644 --- a/xlators/mgmt/glusterd/src/glusterd-hooks.c +++ b/xlators/mgmt/glusterd/src/glusterd-hooks.c @@ -361,7 +361,7 @@ glusterd_hooks_run_hooks (char *hooks_path, glusterd_op_t op, dict_t *op_ctx, ret = -1; line_count = 0; - GF_FOR_EACH_ENTRY_IN_DIR (entry, hookdir, scratch); + GF_SKIP_IRRELEVANT_ENTRIES (entry, hookdir, scratch); while (entry) { if (line_count == N-1) { N *= 2; @@ -375,7 +375,7 @@ glusterd_hooks_run_hooks (char *hooks_path, glusterd_op_t op, dict_t *op_ctx, line_count++; } - GF_FOR_EACH_ENTRY_IN_DIR (entry, hookdir, scratch); + GF_SKIP_IRRELEVANT_ENTRIES (entry, hookdir, scratch); } lines[line_count] = NULL; diff --git a/xlators/mgmt/glusterd/src/glusterd-quota.c b/xlators/mgmt/glusterd/src/glusterd-quota.c index fc34042a8a7..2c21a469820 100644 --- a/xlators/mgmt/glusterd/src/glusterd-quota.c +++ b/xlators/mgmt/glusterd/src/glusterd-quota.c @@ -409,7 +409,7 @@ glusterd_stop_all_quota_crawl_service (glusterd_conf_t *priv, if (dir == NULL) return; - GF_FOR_EACH_ENTRY_IN_DIR (entry, dir, scratch); + GF_SKIP_IRRELEVANT_ENTRIES (entry, dir, scratch); while (entry) { snprintf (pidfile, sizeof (pidfile), "%s/%s", pid_dir, entry->d_name); @@ -418,7 +418,7 @@ glusterd_stop_all_quota_crawl_service (glusterd_conf_t *priv, _gf_true); sys_unlink (pidfile); - GF_FOR_EACH_ENTRY_IN_DIR (entry, dir, scratch); + GF_SKIP_IRRELEVANT_ENTRIES (entry, dir, scratch); } sys_closedir (dir); } 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; } |