summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/storage/posix/src/posix.c')
-rw-r--r--xlators/storage/posix/src/posix.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 7dbd7546cf3..5bfaa4214cc 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -3536,10 +3536,6 @@ posix_fill_readdir (fd_t *fd, DIR *dir, off_t off, size_t size,
break;
}
- if ((uuid_compare (fd->inode->gfid, rootgfid) == 0)
- && (!strcmp (entry->d_name, GF_REPLICATE_TRASH_DIR)))
- continue;
-
#ifdef __NetBSD__
/*
* NetBSD with UFS1 backend uses backing files for
@@ -4068,20 +4064,6 @@ init (xlator_t *this)
_private->base_path = gf_strdup (dir_data->data);
_private->base_path_length = strlen (_private->base_path);
- _private->trash_path = GF_CALLOC (1, _private->base_path_length
- + strlen ("/")
- + strlen (GF_REPLICATE_TRASH_DIR)
- + 1,
- gf_posix_mt_trash_path);
-
- if (!_private->trash_path) {
- ret = -1;
- goto out;
- }
-
- strncpy (_private->trash_path, _private->base_path, _private->base_path_length);
- strcat (_private->trash_path, "/" GF_REPLICATE_TRASH_DIR);
-
LOCK_INIT (&_private->lock);
ret = dict_get_str (this->options, "hostname", &_private->hostname);
@@ -4217,6 +4199,14 @@ init (xlator_t *this)
goto out;
}
+ op_ret = posix_handle_trash_init (this);
+ if (op_ret < 0) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "Posix landfill setup failed");
+ ret = -1;
+ goto out;
+ }
+
pthread_mutex_init (&_private->janitor_lock, NULL);
pthread_cond_init (&_private->janitor_cond, NULL);
INIT_LIST_HEAD (&_private->janitor_fds);