diff options
author | Poornima G <pgurusid@redhat.com> | 2018-08-16 16:36:08 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-12-19 14:36:52 +0000 |
commit | 2af8fca492f3e1152177641b5e6ab9ea59ec0acd (patch) | |
tree | 65dfe1889f015c72f8dcad045bebc2a2197102d0 /xlators/storage/posix/src/posix.h | |
parent | e3ec41af9a9f4d906dd7b512b3f4f91a6f338f4b (diff) |
posix: use synctask for janitor
With brick mux, the number of threads increases as the number of
bricks increases. As an initiative to reduce the number of
threads in brick mux scenario, replacing janitor thread to use
synctask infra.
Now close() and closedir() handle by separate janitor
thread which is linked with glusterfs_ctx.
Updates #475
Change-Id: I0c4aaf728125ab7264442fde59f3d08542785f73
Signed-off-by: Poornima G <pgurusid@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src/posix.h')
-rw-r--r-- | xlators/storage/posix/src/posix.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/xlators/storage/posix/src/posix.h b/xlators/storage/posix/src/posix.h index a1ec996f4b2..97c9666ab44 100644 --- a/xlators/storage/posix/src/posix.h +++ b/xlators/storage/posix/src/posix.h @@ -151,9 +151,6 @@ struct posix_private { time_t last_landfill_check; int32_t janitor_sleep_duration; - struct list_head janitor_fds; - pthread_cond_t janitor_cond; - pthread_mutex_t janitor_lock; int64_t read_value; /* Total read, from init */ int64_t write_value; /* Total write, from init */ @@ -179,9 +176,9 @@ struct posix_private { */ gf_boolean_t background_unlink; - /* janitor thread which cleans up /.trash (created by replicate) */ - pthread_t janitor; - gf_boolean_t janitor_present; + /* janitor task which cleans up /.trash (created by replicate) */ + struct gf_tw_timer_list *janitor; + char *trash_path; /* lock for brick dir */ DIR *mount_lock; @@ -344,7 +341,7 @@ int posix_fhandle_pair(call_frame_t *frame, xlator_t *this, int fd, char *key, data_t *value, int flags, struct iatt *stbuf, fd_t *_fd); void -posix_spawn_janitor_thread(xlator_t *this); +posix_janitor_timer_start(xlator_t *this); int posix_acl_xattr_set(xlator_t *this, const char *path, dict_t *xattr_req); int @@ -664,4 +661,7 @@ posix_cs_maintenance(xlator_t *this, fd_t *fd, loc_t *loc, int *pfd, int posix_check_dev_file(xlator_t *this, inode_t *inode, char *fop, int *op_errno); +void +posix_spawn_ctx_janitor_thread(xlator_t *this); + #endif /* _POSIX_H */ |