diff options
author | Vikas Gorur <vikas@gluster.com> | 2009-12-02 07:48:45 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-12-02 10:29:23 -0800 |
commit | c04c1a170dcc605efcf80c8ae2674b69488b591d (patch) | |
tree | 31add18b6173c517454bdc48d9d508250a1eaded /xlators/storage/posix/src/posix.h | |
parent | 90328b827768552a05bb12abf62d09c9566309d1 (diff) |
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 <vikas@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
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
Diffstat (limited to 'xlators/storage/posix/src/posix.h')
-rw-r--r-- | xlators/storage/posix/src/posix.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/xlators/storage/posix/src/posix.h b/xlators/storage/posix/src/posix.h index b16800c5c93..0a99caeb636 100644 --- a/xlators/storage/posix/src/posix.h +++ b/xlators/storage/posix/src/posix.h @@ -114,6 +114,11 @@ struct posix_private { */ uint64_t gen_seq; gf_lock_t gen_lock; + +/* janitor thread which cleans up /.trash (created by replicate) */ + pthread_t janitor; + gf_boolean_t janitor_present; + char * trash_path; }; #define POSIX_BASE_PATH(this) (((struct posix_private *)this->private)->base_path) |