summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
authorVijay Bellur <vbellur@redhat.com>2013-08-19 00:10:52 +0530
committerVijay Bellur <vbellur@redhat.com>2013-08-19 00:15:17 +0530
commit5734c34be2ef046de1f717e59c931fb55e594d8a (patch)
tree6efa367fdbfe6f9cbaf5b4c95fa24c03c511f0df /xlators/mgmt
parenta1faa636f17dba05377c34c5ca06f8ac95a1645e (diff)
mgmt/glusterd: Correct auto variable initialization.
Previously struct foo { int a; int b; } bar1, bar2 = {0,}; inited only members of bar2 to 0. This has been set right. Also added verification tests for soft-quota configuration. Change-Id: I9e3b4d65286e59d7dad8db8fa649b1b91a5d25bc Signed-off-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-quota.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-quota.c b/xlators/mgmt/glusterd/src/glusterd-quota.c
index 0592585d..1be768af 100644
--- a/xlators/mgmt/glusterd/src/glusterd-quota.c
+++ b/xlators/mgmt/glusterd/src/glusterd-quota.c
@@ -604,10 +604,13 @@ glusterd_set_quota_limit (char *volname, char *path, char *hard_limit,
* OR
* change the data-types of hard_lim and soft_lim_percent to uint64_t
*/
- struct quota_limits {
+ typedef struct quota_limits {
uint64_t hl;
uint64_t sl;
- } __attribute__ ((__packed__)) existing_limit, new_limit = {0,};
+ } __attribute__ ((__packed__)) quota_limits_t;
+
+ quota_limits_t existing_limit = {0,};
+ quota_limits_t new_limit = {0,};
this = THIS;
GF_ASSERT (this);