diff options
author | Niels de Vos <ndevos@redhat.com> | 2017-04-17 15:50:07 +0530 |
---|---|---|
committer | Kaleb KEITHLEY <kkeithle@redhat.com> | 2017-05-01 09:30:14 +0000 |
commit | 73fcf3a874b2049da31d01b8363d1ac85c9488c2 (patch) | |
tree | b9db965e337fde22a7668cb11ffb0351619a924f /libglusterfs/src/Makefile.am | |
parent | 859669759f7fa0f2114add13660ce3bf16c77f30 (diff) |
core: make the per glusterfs_ctx_t timer-wheel refcounted
xlators can use a 'global' timer-wheel for scheduling events. This
timer-wheel is managed per glusterfs_ctx_t, but does not need to be
allocated for every graph. When an xlator wants to use the timer-wheel,
it will be instanciated on demand, and provided to xlators that request
it later on.
By adding a reference counter to the glusterfs_ctx_t for the
timer-wheel, the threads and structures can be cleaned up when the last
xlator does not have a need for it anymore. In general, the xlators
request the timer-wheel in init(), and they should return it in fini().
Because the timer-wheel is managed per glusterfs_ctx_t, the functions
can be added to ctx.c and do not need to live in their very minimal
tw.[ch] files.
Change-Id: I19d225b39aaa272d9005ba7adc3104c3764f1572
BUG: 1442788
Reported-by: Poornima G <pgurusid@redhat.com>
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: https://review.gluster.org/17068
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Zhou Zhengping <johnzzpcrystal@gmail.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'libglusterfs/src/Makefile.am')
-rw-r--r-- | libglusterfs/src/Makefile.am | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libglusterfs/src/Makefile.am b/libglusterfs/src/Makefile.am index 2311c53645a..52b73166ddb 100644 --- a/libglusterfs/src/Makefile.am +++ b/libglusterfs/src/Makefile.am @@ -32,7 +32,7 @@ libglusterfs_la_SOURCES = dict.c xlator.c logging.c \ strfd.c parse-utils.c $(CONTRIBDIR)/mount/mntent.c \ $(CONTRIBDIR)/libexecinfo/execinfo.c quota-common-utils.c rot-buffs.c \ $(CONTRIBDIR)/timer-wheel/timer-wheel.c \ - $(CONTRIBDIR)/timer-wheel/find_last_bit.c tw.c default-args.c locking.c \ + $(CONTRIBDIR)/timer-wheel/find_last_bit.c default-args.c locking.c \ compound-fop-utils.c throttle-tbf.c nodist_libglusterfs_la_SOURCES = y.tab.c graph.lex.c defaults.c @@ -50,7 +50,7 @@ libglusterfs_la_HEADERS = common-utils.h defaults.h default-args.h \ refcount.h run.h options.h lkowner.h fd-lk.h circ-buff.h \ event-history.h gidcache.h client_t.h glusterfs-acl.h \ glfs-message-id.h template-component-messages.h strfd.h \ - syncop-utils.h parse-utils.h libglusterfs-messages.h tw.h \ + syncop-utils.h parse-utils.h libglusterfs-messages.h \ lvm-defaults.h quota-common-utils.h rot-buffs.h \ compat-uuid.h upcall-utils.h throttle-tbf.h events.h\ compound-fop-utils.h atomic.h |