summaryrefslogtreecommitdiffstats
path: root/xlators/features/changetimerecorder
diff options
context:
space:
mode:
authorJoseph Fernandes <josferna@redhat.com>2015-10-23 12:27:32 +0530
committerDan Lambright <dlambrig@redhat.com>2015-11-06 18:36:44 -0800
commit41d7e780fb92ce7d8ab3df6d39baf17a023807a3 (patch)
tree3bc4411129810e6f7e3052a70485f954df2fa1b4 /xlators/features/changetimerecorder
parent009f24544aa9e65731ebe42243b15fadf52c4acc (diff)
tier/ctr: Correcting the internal fop calculation
Correcting the internal fop calculation method, as it had wrong logic. backport of http://review.gluster.org/#/c/12418/ Change-Id: I1deeae8b67dd967159853b494e89a3f46572c962 BUG: 1275483 Signed-off-by: Joseph Fernandes <josferna@redhat.com> Reviewed-on: http://review.gluster.org/12423 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com> Tested-by: Dan Lambright <dlambrig@redhat.com>
Diffstat (limited to 'xlators/features/changetimerecorder')
-rw-r--r--xlators/features/changetimerecorder/src/changetimerecorder.c6
-rw-r--r--xlators/features/changetimerecorder/src/ctr-helper.h39
2 files changed, 28 insertions, 17 deletions
diff --git a/xlators/features/changetimerecorder/src/changetimerecorder.c b/xlators/features/changetimerecorder/src/changetimerecorder.c
index 090e54c..fb33767 100644
--- a/xlators/features/changetimerecorder/src/changetimerecorder.c
+++ b/xlators/features/changetimerecorder/src/changetimerecorder.c
@@ -881,7 +881,7 @@ ctr_unlink (call_frame_t *frame, xlator_t *this,
GFDB_FOP_DENTRY_WRITE, GFDB_FOP_WDEL);
/*Internal FOP*/
- _inode_cx->is_internal_fop = CTR_IS_INTERNAL_FOP(frame, xdata);
+ _inode_cx->is_internal_fop = is_internal_fop (frame, xdata);
/* If its a internal FOP and dht link file donot record*/
if (_inode_cx->is_internal_fop &&
@@ -1219,7 +1219,7 @@ ctr_create (call_frame_t *frame, xlator_t *this,
GFDB_FOP_CREATE_WRITE, GFDB_FOP_WIND);
/*Internal FOP*/
- _inode_cx->is_internal_fop = CTR_IS_INTERNAL_FOP(frame, xdata);
+ _inode_cx->is_internal_fop = is_internal_fop (frame, xdata);
/* If its a internal FOP and dht link file donot record*/
if (_inode_cx->is_internal_fop &&
@@ -1299,7 +1299,7 @@ ctr_link (call_frame_t *frame, xlator_t *this,
GFDB_FOP_DENTRY_WRITE, GFDB_FOP_WIND);
/*Internal FOP*/
- _inode_cx->is_internal_fop = CTR_IS_INTERNAL_FOP(frame, xdata);
+ _inode_cx->is_internal_fop = is_internal_fop (frame, xdata);
/* If its a internal FOP and dht link file donot record*/
if (_inode_cx->is_internal_fop &&
diff --git a/xlators/features/changetimerecorder/src/ctr-helper.h b/xlators/features/changetimerecorder/src/ctr-helper.h
index 51dec44..e030414 100644
--- a/xlators/features/changetimerecorder/src/ctr-helper.h
+++ b/xlators/features/changetimerecorder/src/ctr-helper.h
@@ -287,23 +287,34 @@ do {\
* Internal fop
*
* */
-#define CTR_IS_INTERNAL_FOP(frame, dict)\
- (AFR_SELF_HEAL_FOP (frame) \
- || (REBALANCE_FOP (frame) && dict && \
- !dict_get (dict, CTR_ATTACH_TIER_LOOKUP)) \
- || (TIER_REBALANCE_FOP (frame) && dict && \
- !dict_get (dict, CTR_ATTACH_TIER_LOOKUP)) \
- || (dict && \
- dict_get (dict, GLUSTERFS_INTERNAL_FOP_KEY)))
+static inline
+gf_boolean_t is_internal_fop (call_frame_t *frame,
+ dict_t *xdata)
+{
+ gf_boolean_t ret = _gf_false;
+
+ GF_ASSERT(frame);
+ GF_ASSERT(frame->root);
+
+ if (AFR_SELF_HEAL_FOP (frame)) {
+ ret = _gf_true;
+ }
+ if (REBALANCE_FOP (frame) || TIER_REBALANCE_FOP (frame)) {
+ ret = _gf_true;
+ if (xdata && dict_get (xdata, CTR_ATTACH_TIER_LOOKUP)) {
+ ret = _gf_false;
+ }
+ }
+ if (xdata && dict_get (xdata, GLUSTERFS_INTERNAL_FOP_KEY)) {
+ ret = _gf_true;
+ }
+
+ return ret;
+}
-/**
- * ignore internal fops for all clients except AFR self-heal daemon
- */
#define CTR_IF_INTERNAL_FOP_THEN_GOTO(frame, dict, label)\
do {\
- GF_ASSERT(frame);\
- GF_ASSERT(frame->root);\
- if (CTR_IS_INTERNAL_FOP(frame, dict)) \
+ if (is_internal_fop (frame, dict)) \
goto label; \
} while (0)