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 /libglusterfs | |
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 'libglusterfs')
-rw-r--r-- | libglusterfs/src/common-utils.c | 4 | ||||
-rw-r--r-- | libglusterfs/src/common-utils.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index ec1d5c4823c..e855f04a443 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -4364,7 +4364,7 @@ recursive_rmdir (const char *delete_path) 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_lstat (path, &st); @@ -4387,7 +4387,7 @@ recursive_rmdir (const char *delete_path) gf_msg_debug (this->name, 0, "%s %s", ret ? "Failed to remove" : "Removed", entry->d_name); - GF_FOR_EACH_ENTRY_IN_DIR (entry, dir, scratch); + GF_SKIP_IRRELEVANT_ENTRIES (entry, dir, scratch); } ret = sys_closedir (dir); diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h index bfb36dfa83d..799a356d8a5 100644 --- a/libglusterfs/src/common-utils.h +++ b/libglusterfs/src/common-utils.h @@ -444,7 +444,7 @@ union gf_sock_union { #define IOV_MIN(n) min(IOV_MAX,n) -#define GF_FOR_EACH_ENTRY_IN_DIR(entry, dir, scr) \ +#define GF_SKIP_IRRELEVANT_ENTRIES(entry, dir, scr) \ do {\ entry = NULL;\ if (dir) { \ |