diff options
author | Raghavendra Bhat <raghavendra@redhat.com> | 2016-05-12 16:40:04 -0400 |
---|---|---|
committer | Raghavendra Bhat <raghavendra@redhat.com> | 2017-04-18 23:29:46 -0400 |
commit | e3d9018f2ddc28548c0aa18960a3a524521c9ad7 (patch) | |
tree | 75021b8f2456708d2d902e4c6e7ea54958173d64 /xlators/features/bit-rot/src/stub/bit-rot-stub.h | |
parent | 10dad995c989e9d77c341135d7c48817baba966c (diff) |
features/bit-rot-stub: bring in optional versioning
* As of now bit-rot-stub does versioning always. This leads
lots of getxattr calls being made in lookups. So make
object versioning optional.
Change-Id: I83713e45ae59fb28004bb3cfa008f2d69edebbfa
BUG: 1359599
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Reviewed-on: https://review.gluster.org/14442
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/features/bit-rot/src/stub/bit-rot-stub.h')
-rw-r--r-- | xlators/features/bit-rot/src/stub/bit-rot-stub.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/xlators/features/bit-rot/src/stub/bit-rot-stub.h b/xlators/features/bit-rot/src/stub/bit-rot-stub.h index 3facf2fe9c6..433fa68538a 100644 --- a/xlators/features/bit-rot/src/stub/bit-rot-stub.h +++ b/xlators/features/bit-rot/src/stub/bit-rot-stub.h @@ -18,6 +18,7 @@ #include "call-stub.h" #include "bit-rot-stub-mem-types.h" #include "syscall.h" +#include "common-utils.h" #include "bit-rot-common.h" #include "bit-rot-stub-messages.h" #include "glusterfs3-xdr.h" @@ -30,6 +31,29 @@ #define OLD_BR_STUB_QUARANTINE_DIR GF_HIDDEN_PATH"/quanrantine" #define BR_STUB_QUARANTINE_DIR GF_HIDDEN_PATH"/quarantine" +/* do not reference frame->local in cbk unless initialized. + * Assigned 0x1 marks verisoning flag between call path and + * cbk path. + */ +#define BR_STUB_VER_NOT_ACTIVE_THEN_GOTO(frame, priv, label) do { \ + if (priv->do_versioning) \ + frame->local = (void *)0x1; \ + else \ + goto label; \ + } while (0) + +#define BR_STUB_VER_COND_GOTO(priv, cond, label) do { \ + if (!priv->do_versioning || cond) \ + goto label; \ + } while (0) + +#define BR_STUB_VER_ENABLED_IN_CALLPATH(frame, flag) do { \ + if (frame->local) \ + flag = _gf_true; \ + if (frame->local == (void *) 0x1) \ + frame->local = NULL; \ + } while (0) + typedef int (br_stub_version_cbk) (call_frame_t *, void *, xlator_t *, int32_t, int32_t, dict_t *); @@ -80,7 +104,7 @@ typedef struct br_stub_local { #define BR_STUB_INCREMENTAL_VERSIONING (1 << 1) typedef struct br_stub_private { - gf_boolean_t go; + gf_boolean_t do_versioning; uint32_t boot[2]; char export[PATH_MAX]; |