From c04c1a170dcc605efcf80c8ae2674b69488b591d Mon Sep 17 00:00:00 2001 From: Vikas Gorur Date: Wed, 2 Dec 2009 07:48:45 +0000 Subject: storage/posix: Added janitor thread. The janitor thread deletes all files and directories in the "/" GF_REPLICATE_TRASH_DIR directory. This directory is used by replicate self-heal to dump files and directories it deletes. This is needed because letting replicate walk the directory tree and delete a directory and all its children is too racy. Instead, replicate self-heal only does an atomic rename(), and the janitor thread takes care of actually deleting them. Signed-off-by: Vikas Gorur Signed-off-by: Anand V. Avati BUG: 227 (replicate selfheal does not remove directory with contents in it) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=227 --- xlators/cluster/afr/src/afr-dir-read.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xlators/cluster/afr/src/afr-dir-read.c') diff --git a/xlators/cluster/afr/src/afr-dir-read.c b/xlators/cluster/afr/src/afr-dir-read.c index fab60b66ef7..b48488526e5 100644 --- a/xlators/cluster/afr/src/afr-dir-read.c +++ b/xlators/cluster/afr/src/afr-dir-read.c @@ -361,7 +361,7 @@ afr_readdir_cbk (call_frame_t *frame, void *cookie, child_index); if ((local->fd->inode == local->fd->inode->table->root) - && !strcmp (entry->d_name, AFR_TRASH_DIR)) { + && !strcmp (entry->d_name, GF_REPLICATE_TRASH_DIR)) { list_del_init (&entry->list); FREE (entry); } @@ -405,7 +405,7 @@ afr_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this, entry->d_stat.st_ino = inum; if ((local->fd->inode == local->fd->inode->table->root) - && !strcmp (entry->d_name, AFR_TRASH_DIR)) { + && !strcmp (entry->d_name, GF_REPLICATE_TRASH_DIR)) { list_del_init (&entry->list); FREE (entry); } -- cgit