summaryrefslogtreecommitdiffstats
path: root/xlators/features/trash/src/trash.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/features/trash/src/trash.c')
-rw-r--r--xlators/features/trash/src/trash.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/xlators/features/trash/src/trash.c b/xlators/features/trash/src/trash.c
index 665737389b9..e14edf0eea7 100644
--- a/xlators/features/trash/src/trash.c
+++ b/xlators/features/trash/src/trash.c
@@ -602,6 +602,8 @@ trash_unlink_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
local = frame->local;
GF_VALIDATE_OR_GOTO ("trash", local, out);
+ TRASH_UNSET_PID (frame, local);
+
tmp_str = gf_strdup (local->newpath);
if (!tmp_str) {
gf_log (this->name, GF_LOG_ERROR, "out of memory");
@@ -649,6 +651,9 @@ trash_unlink_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
remove_trash_path (tmp_path, (frame->root->pid < 0), &tmp_stat);
if (tmp_stat)
strcat (real_path, tmp_stat);
+
+ TRASH_SET_PID (frame, local);
+
STACK_WIND_COOKIE (frame, trash_unlink_mkdir_cbk, tmp_path,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->mkdir,
@@ -720,6 +725,8 @@ trash_unlink_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (tmp_stat)
strcat (real_path, tmp_stat);
+ TRASH_SET_PID (frame, local);
+
STACK_WIND_COOKIE (frame, trash_unlink_mkdir_cbk, tmp_path,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->mkdir, &tmp_loc,
@@ -791,6 +798,9 @@ trash_unlink_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
remove_trash_path (tmp_str, (frame->root->pid < 0), &tmp_stat);
if (tmp_stat)
strcat (real_path, tmp_stat);
+
+ TRASH_SET_PID (frame, local);
+
/* create the directory with proper permissions */
STACK_WIND_COOKIE (frame, trash_unlink_mkdir_cbk, tmp_cookie,
FIRST_CHILD(this),
@@ -1309,6 +1319,9 @@ trash_truncate_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
remove_trash_path (tmp_path, (frame->root->pid < 0), &tmp_stat);
if (tmp_stat)
strcat (real_path, tmp_stat);
+
+ TRASH_SET_PID (frame, local);
+
/* create the directory with proper permissions */
STACK_WIND_COOKIE (frame, trash_truncate_mkdir_cbk,
tmp_path, FIRST_CHILD(this),
@@ -1387,6 +1400,8 @@ trash_truncate_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
loop_count = local->loop_count;
+ TRASH_UNSET_PID (frame, local);
+
tmp_str = gf_strdup (local->newpath);
if (!tmp_str) {
gf_log (this->name, GF_LOG_DEBUG, "out of memory");
@@ -1432,6 +1447,9 @@ trash_truncate_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
remove_trash_path (tmp_path, (frame->root->pid < 0), &tmp_stat);
if (tmp_stat)
strcat (real_path, tmp_stat);
+
+ TRASH_SET_PID (frame, local);
+
STACK_WIND_COOKIE (frame, trash_truncate_mkdir_cbk,
tmp_path, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->mkdir,
@@ -1503,6 +1521,8 @@ trash_truncate_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (tmp_stat)
strcat (real_path, tmp_stat);
+ TRASH_SET_PID (frame, local);
+
STACK_WIND_COOKIE (frame, trash_truncate_mkdir_cbk, tmp_path,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->mkdir, &tmp_loc,