summaryrefslogtreecommitdiffstats
path: root/xlators/features/marker
diff options
context:
space:
mode:
authorvmallika <vmallika@redhat.com>2015-11-18 17:25:14 +0530
committerRaghavendra G <rgowdapp@redhat.com>2015-11-23 22:04:46 -0800
commit99657b970855d9735a195e8ac19c8f1011d0d713 (patch)
treeff42fa725a84eb70199725d1c27dbc9304ffb34f /xlators/features/marker
parentabff11e77918a355550fdc3591743cee6cc7103d (diff)
quota: fix backward compatibility of quota xattr version
This is a backport of http://review.gluster.org/#/c/12660/ quota-version features is implemented for 3.7.6 please see below patch for more details: http://review.gluster.org/#/c/12386 Problem is when quota is already enabled, we suffix 0 to contri xattr key. for backward compatibility don't add suffix if quota-version is 0 > Change-Id: Id7d713b18d989e4e86019969eb511617848127f2 > BUG: 1283567 > Signed-off-by: vmallika <vmallika@redhat.com> Change-Id: Id6e562b2cb6497f8205f13449b21a71c75bf343b BUG: 1283568 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/12661 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/features/marker')
-rw-r--r--xlators/features/marker/src/marker-quota.h36
1 files changed, 18 insertions, 18 deletions
diff --git a/xlators/features/marker/src/marker-quota.h b/xlators/features/marker/src/marker-quota.h
index 387db4e..dbfd286 100644
--- a/xlators/features/marker/src/marker-quota.h
+++ b/xlators/features/marker/src/marker-quota.h
@@ -61,33 +61,33 @@
ret = 0; \
} while (0);
-#define GET_CONTRI_KEY(_this, var, _gfid, _ret) \
+#define GET_QUOTA_KEY(_this, var, key, _ret) \
do { \
marker_conf_t *_priv = _this->private; \
+ if (_priv->version > 0) \
+ _ret = snprintf (var, QUOTA_KEY_MAX, "%s.%d", \
+ key, _priv->version); \
+ else \
+ _ret = snprintf (var, QUOTA_KEY_MAX, "%s", key); \
+ } while (0)
+
+#define GET_CONTRI_KEY(_this, var, _gfid, _ret) \
+ do { \
+ char _tmp_var[QUOTA_KEY_MAX] = {0, }; \
if (_gfid != NULL) { \
char _gfid_unparsed[40]; \
gf_uuid_unparse (_gfid, _gfid_unparsed); \
- _ret = snprintf (var, QUOTA_KEY_MAX, \
+ _ret = snprintf (_tmp_var, QUOTA_KEY_MAX, \
QUOTA_XATTR_PREFIX \
- ".%s.%s." CONTRIBUTION ".%d", \
- "quota", _gfid_unparsed, \
- _priv->version); \
+ ".%s.%s." CONTRIBUTION, \
+ "quota", _gfid_unparsed); \
} else { \
- _ret = snprintf (var, QUOTA_KEY_MAX, \
+ _ret = snprintf (_tmp_var, QUOTA_KEY_MAX, \
QUOTA_XATTR_PREFIX \
- ".%s.." CONTRIBUTION ".%d", \
- "quota", _priv->version); \
+ ".%s.." CONTRIBUTION, \
+ "quota"); \
} \
- } while (0)
-
-#define GET_QUOTA_KEY(_this, var, key, _ret) \
- do { \
- marker_conf_t *_priv = _this->private; \
- if (_priv->version > 0) \
- _ret = snprintf (var, QUOTA_KEY_MAX, "%s.%d", \
- key, _priv->version); \
- else \
- _ret = snprintf (var, QUOTA_KEY_MAX, "%s", key); \
+ GET_QUOTA_KEY (_this, var, _tmp_var, _ret); \
} while (0)
#define GET_SIZE_KEY(_this, var, _ret) \