summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
Diffstat (limited to 'xlators')
-rw-r--r--xlators/features/bit-rot/src/bitd/bit-rot.c6
-rw-r--r--xlators/features/leases/src/leases.c18
-rw-r--r--xlators/features/leases/src/leases.h1
-rw-r--r--xlators/performance/nl-cache/src/nl-cache.c18
4 files changed, 16 insertions, 27 deletions
diff --git a/xlators/features/bit-rot/src/bitd/bit-rot.c b/xlators/features/bit-rot/src/bitd/bit-rot.c
index e55a22f1cdc..6e86ceb02e7 100644
--- a/xlators/features/bit-rot/src/bitd/bit-rot.c
+++ b/xlators/features/bit-rot/src/bitd/bit-rot.c
@@ -21,8 +21,6 @@
#include <pthread.h>
#include "bit-rot-bitd-messages.h"
-#include "tw.h"
-
#define BR_HASH_CALC_READ_SIZE (128 * 1024)
typedef int32_t (br_child_handler)(xlator_t *, br_child_t *);
@@ -1994,7 +1992,7 @@ init (xlator_t *this)
INIT_LIST_HEAD (&priv->bricks);
INIT_LIST_HEAD (&priv->signing);
- priv->timer_wheel = glusterfs_global_timer_wheel (this);
+ priv->timer_wheel = glusterfs_ctx_tw_get (this->ctx);
if (!priv->timer_wheel) {
gf_msg (this->name, GF_LOG_ERROR, 0,
BRB_MSG_TIMER_WHEEL_UNAVAILABLE,
@@ -2062,6 +2060,8 @@ fini (xlator_t *this)
this->private = NULL;
GF_FREE (priv);
+ glusterfs_ctx_tw_put (this->ctx);
+
return;
}
diff --git a/xlators/features/leases/src/leases.c b/xlators/features/leases/src/leases.c
index 3e0460000d7..faffa0e71f8 100644
--- a/xlators/features/leases/src/leases.c
+++ b/xlators/features/leases/src/leases.c
@@ -957,19 +957,11 @@ leases_init_priv (xlator_t *this)
GF_ASSERT (priv);
if (!priv->timer_wheel) {
- if (!glusterfs_global_timer_wheel (this)) {
- gf_msg_debug (this->name, 0, "Initing the global "
- "timer wheel");
- ret = glusterfs_global_timer_wheel_init (this->ctx);
- if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
- LEASE_MSG_NO_TIMER_WHEEL,
- "Initing the global timer "
- "wheel failed");
- goto out;
- }
+ priv->timer_wheel = glusterfs_ctx_tw_get (this->ctx);
+ if (!priv->timer_wheel) {
+ ret = -1;
+ goto out;
}
- priv->timer_wheel = glusterfs_global_timer_wheel (this);
}
if (!priv->inited_recall_thr) {
@@ -1076,6 +1068,8 @@ fini (xlator_t *this)
GF_FREE (priv);
+ glusterfs_ctx_tw_put (this->ctx);
+
return 0;
}
diff --git a/xlators/features/leases/src/leases.h b/xlators/features/leases/src/leases.h
index 703c4d809cd..443c6a22324 100644
--- a/xlators/features/leases/src/leases.h
+++ b/xlators/features/leases/src/leases.h
@@ -26,7 +26,6 @@
#include "lkowner.h"
#include "locking.h"
#include "upcall-utils.h"
-#include "tw.h"
#include "timer-wheel.h"
#include "leases-mem-types.h"
#include "leases-messages.h"
diff --git a/xlators/performance/nl-cache/src/nl-cache.c b/xlators/performance/nl-cache/src/nl-cache.c
index f301b2d06dd..f8d2642be30 100644
--- a/xlators/performance/nl-cache/src/nl-cache.c
+++ b/xlators/performance/nl-cache/src/nl-cache.c
@@ -12,7 +12,6 @@
#include "nl-cache.h"
#include "statedump.h"
#include "upcall-utils.h"
-#include "tw.h"
static void
nlc_dentry_op (call_frame_t *frame, xlator_t *this, gf_boolean_t multilink)
@@ -627,6 +626,8 @@ nlc_priv_dump (xlator_t *this)
void
fini (xlator_t *this)
{
+ glusterfs_ctx_tw_put (this->ctx);
+
return;
}
@@ -702,17 +703,12 @@ init (xlator_t *this)
INIT_LIST_HEAD (&conf->lru);
time (&conf->last_child_down);
- if (!glusterfs_global_timer_wheel (this)) {
- gf_msg_debug (this->name, 0, "Initing the global timer wheel");
- ret = glusterfs_global_timer_wheel_init (this->ctx);
- if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
- NLC_MSG_NO_TIMER_WHEEL,
- "Initing the global timer wheel failed");
- goto out;
- }
+ conf->timer_wheel = glusterfs_ctx_tw_get (this->ctx);
+ if (!conf->timer_wheel) {
+ gf_msg (this->name, GF_LOG_ERROR, 0, NLC_MSG_NO_TIMER_WHEEL,
+ "Initing the global timer wheel failed");
+ goto out;
}
- conf->timer_wheel = glusterfs_global_timer_wheel (this);
this->private = conf;