summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix.h
diff options
context:
space:
mode:
authorVikas Gorur <vikas@gluster.com>2010-01-15 06:59:00 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-01-19 05:56:35 -0800
commita23185f3a43ec95a56af9f0f543b67a1fcfb4852 (patch)
tree3af85514c46c3d84ed779fa111c3ef7021572af6 /xlators/storage/posix/src/posix.h
parent4951f4dcc1b795b42fa845b6a89a9902af5b6586 (diff)
storage/posix: Hand off calling close() and closedir() to the janitor thread.
Let the janitor thread handle calling close() and closedir() on fd's and DIR * when posix_release is called. This avoids blocking the main server loop due to close(). Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 533 (close() should not block main loop) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=533
Diffstat (limited to 'xlators/storage/posix/src/posix.h')
-rw-r--r--xlators/storage/posix/src/posix.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/xlators/storage/posix/src/posix.h b/xlators/storage/posix/src/posix.h
index 0a99caeb636..3280c979e79 100644
--- a/xlators/storage/posix/src/posix.h
+++ b/xlators/storage/posix/src/posix.h
@@ -61,8 +61,10 @@ struct posix_fd {
char * path; /* used by setdents/getdents */
DIR * dir; /* handle returned by the kernel */
int flushwrites;
+ struct list_head list; /* to add to the janitor list */
};
+
struct posix_private {
char *base_path;
int32_t base_path_length;
@@ -76,6 +78,10 @@ struct posix_private {
struct timeval prev_fetch_time;
struct timeval init_time;
+ struct list_head janitor_fds;
+ pthread_cond_t janitor_cond;
+ pthread_mutex_t janitor_lock;
+
int32_t max_read; /* */
int32_t max_write; /* */
int64_t interval_read; /* Used to calculate the max_read value */