diff options
author | Kotresh H R <khiremat@redhat.com> | 2014-04-08 13:50:30 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-05-01 08:45:15 -0700 |
commit | 4b5ad0d6510d88767762e9c2ef5d028b674a6765 (patch) | |
tree | e1366fd6b37c14ae3b047a14cc40ac65366dbebf /xlators/features/changelog/src/changelog-helpers.h | |
parent | c523a04a0bd3edce9cf8ed238b838ebd957f1066 (diff) |
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 <khiremat@redhat.com>
Change-Id: Iea9c62fafc86242f9404e03679b1941aa9c88c9a
Signed-off-by: Kotresh H R <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/7415
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Reviewed-by: Varun Shastry <vshastry@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/features/changelog/src/changelog-helpers.h')
-rw-r--r-- | xlators/features/changelog/src/changelog-helpers.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/xlators/features/changelog/src/changelog-helpers.h b/xlators/features/changelog/src/changelog-helpers.h index 54577592c90..8e591e2f935 100644 --- a/xlators/features/changelog/src/changelog-helpers.h +++ b/xlators/features/changelog/src/changelog-helpers.h @@ -17,6 +17,7 @@ #include "iobuf.h" #include "changelog-misc.h" +#include "call-stub.h" /** * the changelog entry @@ -186,7 +187,7 @@ typedef struct drain_mgmt { gf_boolean_t drain_wait_white; }drain_mgmt_t; -/* Internal and External barrier on/off indicating flags */ +/* External barrier as a result of snap on/off indicating flag*/ typedef struct barrier_flags { gf_lock_t lock; gf_boolean_t barrier_ext; @@ -265,6 +266,11 @@ struct changelog_priv { /* barrier on/off indicating flags */ barrier_flags_t bflags; + + /* changelog barrier on/off indicating flag */ + gf_boolean_t barrier_enabled; + struct list_head queue; + uint32_t queue_size; }; struct changelog_local { @@ -401,12 +407,19 @@ changelog_dec_fop_cnt (xlator_t *this, changelog_priv_t *priv, inline int changelog_barrier_notify (changelog_priv_t *priv, char* buf); 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); void changelog_drain_white_fops (xlator_t *this, changelog_priv_t *priv); void changelog_drain_black_fops (xlator_t *this, changelog_priv_t *priv); +/* Changelog barrier routines */ +void __chlog_barrier_enqueue (xlator_t *this, call_stub_t *stub); +void __chlog_barrier_disable (xlator_t *this, struct list_head *queue); +void chlog_barrier_dequeue_all (xlator_t *this, struct list_head *queue); +call_stub_t *__chlog_barrier_dequeue (xlator_t *this, struct list_head *queue); + /* macros */ #define CHANGELOG_STACK_UNWIND(fop, frame, params ...) do { \ |