summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix-helpers.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/storage/posix/src/posix-helpers.c')
-rw-r--r--xlators/storage/posix/src/posix-helpers.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c
index 8f550f9fe0d..525f65f7eba 100644
--- a/xlators/storage/posix/src/posix-helpers.c
+++ b/xlators/storage/posix/src/posix-helpers.c
@@ -1414,15 +1414,22 @@ posix_janitor_thread_proc (void *data)
time (&now);
if ((now - priv->last_landfill_check) > priv->janitor_sleep_duration) {
- gf_msg_trace (this->name, 0,
- "janitor cleaning out %s",
- priv->trash_path);
-
- nftw (priv->trash_path,
- janitor_walker,
- 32,
- FTW_DEPTH | FTW_PHYS);
+ if (priv->disable_landfill_purge) {
+ gf_msg_debug (this->name, 0,
+ "Janitor would have "
+ "cleaned out %s, but purge"
+ "is disabled.",
+ priv->trash_path);
+ } else {
+ gf_msg_trace (this->name, 0,
+ "janitor cleaning out %s",
+ priv->trash_path);
+ nftw (priv->trash_path,
+ janitor_walker,
+ 32,
+ FTW_DEPTH | FTW_PHYS);
+ }
priv->last_landfill_check = now;
}