summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix.c
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2012-04-14 12:21:25 +0530
committerAnand Avati <avati@redhat.com>2012-05-31 16:52:44 -0700
commitd2ac835ba0d51ce1679dc71640472eecbfbaa704 (patch)
tree1c409b85bf7e4a6272a9f9430bdcd1ec8cb74bd7 /xlators/storage/posix/src/posix.c
parent67740785050158dad8793f8d0ab6beeb30f99b3f (diff)
storage/posix: Move landfill inside .glusterfs
Change-Id: Ia2944f891dd62e72f3c79678c3a1fed389854a90 BUG: 811970 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.com/3158 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
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 7dbd7546c..5bfaa4214 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);