From d2ac835ba0d51ce1679dc71640472eecbfbaa704 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Sat, 14 Apr 2012 12:21:25 +0530 Subject: storage/posix: Move landfill inside .glusterfs Change-Id: Ia2944f891dd62e72f3c79678c3a1fed389854a90 BUG: 811970 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.com/3158 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/storage/posix/src/posix.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'xlators/storage/posix/src/posix.c') diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 7dbd7546..5bfaa421 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); -- cgit