diff options
Diffstat (limited to 'xlators/features/changelog/src/changelog-rt.c')
-rw-r--r-- | xlators/features/changelog/src/changelog-rt.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/xlators/features/changelog/src/changelog-rt.c b/xlators/features/changelog/src/changelog-rt.c index 4e801ae85..91d47e059 100644 --- a/xlators/features/changelog/src/changelog-rt.c +++ b/xlators/features/changelog/src/changelog-rt.c @@ -21,7 +21,8 @@ #include "changelog-mem-types.h" int -changelog_rt_init (xlator_t *this, changelog_dispatcher_t *cd) +changelog_rt_init (xlator_t *this, + changelog_dispatcher_t *cd, gf_boolean_t lockless_update) { changelog_rt_t *crt = NULL; @@ -30,10 +31,12 @@ changelog_rt_init (xlator_t *this, changelog_dispatcher_t *cd) if (!crt) return -1; + /* TBD: don't init (and destroy) if lock-less update */ LOCK_INIT (&crt->lock); cd->cd_data = crt; - cd->dispatchfn = &changelog_rt_enqueue; + cd->dispatchfn = lockless_update ? + &changelog_rt_enqueue_lockless : &changelog_rt_enqueue; return 0; } @@ -69,3 +72,12 @@ changelog_rt_enqueue (xlator_t *this, return ret; } + +int +changelog_rt_enqueue_lockless (xlator_t *this, + changelog_priv_t *priv, void *cbatch, + changelog_local_t *local, + changelog_log_data_t *cld_0) +{ + return changelog_handle_change (this, priv, local, cld_0); +} |