diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2014-03-23 08:01:15 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-03-24 11:08:27 -0700 |
commit | 00802b3a484499267af2e4474d75d3f75887ad07 (patch) | |
tree | 4cc63cebf4f8c6fe989ab662fe6b0858b086244a /xlators/features | |
parent | f7a815a2d0e7e9d7ed1ec2da587790bd3ddda9e5 (diff) |
features/compress: Add mem accounting support for compress
Change-Id: I89a7a4cd64ef65ad3bab180d66797a62b4e1e195
BUG: 923540
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/7320
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Prashanth Pai <ppai@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/features')
-rw-r--r-- | xlators/features/compress/src/cdc-mem-types.h | 1 | ||||
-rw-r--r-- | xlators/features/compress/src/cdc.c | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/xlators/features/compress/src/cdc-mem-types.h b/xlators/features/compress/src/cdc-mem-types.h index efa00805987..ead2c70ba6e 100644 --- a/xlators/features/compress/src/cdc-mem-types.h +++ b/xlators/features/compress/src/cdc-mem-types.h @@ -17,6 +17,7 @@ enum gf_cdc_mem_types { gf_cdc_mt_priv_t = gf_common_mt_end + 1, gf_cdc_mt_vec_t = gf_common_mt_end + 2, gf_cdc_mt_gzip_trailer_t = gf_common_mt_end + 3, + gf_cdc_mt_end = gf_common_mt_end + 4, }; #endif diff --git a/xlators/features/compress/src/cdc.c b/xlators/features/compress/src/cdc.c index a334c7e061c..67fc52505e5 100644 --- a/xlators/features/compress/src/cdc.c +++ b/xlators/features/compress/src/cdc.c @@ -190,6 +190,25 @@ cdc_writev (call_frame_t *frame, } int32_t +mem_acct_init (xlator_t *this) +{ + int ret = -1; + + if (!this) + return ret; + + ret = xlator_mem_acct_init (this, gf_cdc_mt_end); + + if (ret != 0) { + gf_log(this->name, GF_LOG_ERROR, "Memory accounting init" + "failed"); + return ret; + } + + return ret; +} + +int32_t init (xlator_t *this) { int ret = -1; |