From 4b5ad0d6510d88767762e9c2ef5d028b674a6765 Mon Sep 17 00:00:00 2001 From: Kotresh H R Date: Tue, 8 Apr 2014 13:50:30 +0530 Subject: features/changelog: Barrier in changelog during snapshot. Changelog barriers unlink, rename, rmdir fops on barrier 'on' notification from glusterfsd mgmt layer and unbarriers the same on barrier 'off' notification during snapshot. Please see the following link for more details. http://www.gluster.org/community/documentation/index.php/Changelog_Design_changes_for_snapshot Signed-off-by: Kotresh H R Change-Id: Iea9c62fafc86242f9404e03679b1941aa9c88c9a Signed-off-by: Kotresh H R Reviewed-on: http://review.gluster.org/7415 Reviewed-by: Venky Shankar Reviewed-by: Varun Shastry Tested-by: Gluster Build System --- xlators/features/changelog/src/changelog-helpers.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'xlators/features/changelog/src/changelog-helpers.c') diff --git a/xlators/features/changelog/src/changelog-helpers.c b/xlators/features/changelog/src/changelog-helpers.c index c3661b9b76c..2d412e7b60d 100644 --- a/xlators/features/changelog/src/changelog-helpers.c +++ b/xlators/features/changelog/src/changelog-helpers.c @@ -988,9 +988,9 @@ changelog_barrier_notify (changelog_priv_t *priv, char *buf) } /* Clean up flags set on barrier notification */ -/*TODO: Add changelog barrier stop code with changelog barrier patch*/ inline void -changelog_barrier_cleanup (xlator_t *this, changelog_priv_t *priv) +changelog_barrier_cleanup (xlator_t *this, changelog_priv_t *priv, + struct list_head *queue) { int ret = 0; @@ -1005,6 +1005,19 @@ changelog_barrier_cleanup (xlator_t *this, changelog_priv_t *priv) } ret = pthread_mutex_unlock (&priv->bn.bnotify_mutex); CHANGELOG_PTHREAD_ERROR_HANDLE_0 (ret, out); + + /* Disable changelog barrier and dequeue fops */ + LOCK (&priv->lock); + { + if (priv->barrier_enabled == _gf_true) + __chlog_barrier_disable (this, queue); + else + ret = -1; + } + UNLOCK (&priv->lock); + if (ret == 0) + chlog_barrier_dequeue_all(this, queue); + out: return; } -- cgit