summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorJoseph Fernandes <josferna@redhat.com>2015-10-23 12:27:32 +0530
committerDan Lambright <dlambrig@redhat.com>2015-10-25 06:49:23 -0700
commit30653175901204b40b051e510253f09d76b3555b (patch)
tree56ddbe90fec5190da1efe8805d7441a9e6f364f7 /xlators
parentfb2a511493868a9ff0c2926537a4d1d23821ce38 (diff)
tier/ctr: Correcting the internal fop calculation
Correcting the internal fop calculation method, as it had wrong logic. Change-Id: I1d0b40a1e27548147203ddd503794059652ac049 Signed-off-by: Joseph Fernandes <josferna@redhat.com> Reviewed-on: http://review.gluster.org/12418 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')
-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 7305f68c4c5..c75cf2b03c0 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 4f650350c94..444b2c8f161 100644
--- a/xlators/features/changetimerecorder/src/ctr-helper.h
+++ b/xlators/features/changetimerecorder/src/ctr-helper.h
@@ -282,23 +282,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)