diff options
| -rw-r--r-- | xlators/features/changetimerecorder/src/changetimerecorder.c | 6 | ||||
| -rw-r--r-- | xlators/features/changetimerecorder/src/ctr-helper.h | 39 | 
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)  | 
