From ca6af761fb63068b170b9e8b1143598af244e06c Mon Sep 17 00:00:00 2001 From: Prashanth Pai Date: Tue, 25 Mar 2014 16:15:15 +0530 Subject: features/glupy: Add mem accounting support When glusterfs is built from source using -DDEBUG flag and glupy xlator is added to vol file, the brick process used to crash when mounting the volume. This fix is largely derived from the fix submitted for BZ #1035751. Thanks to Justin Clift for helping in tracking this down. BUG: 1035751 Change-Id: Id64f92eecc9335e34dd08812fe176774e7723c2c Signed-off-by: Prashanth Pai Reviewed-on: http://review.gluster.org/7332 Reviewed-by: Jeff Darcy Tested-by: Gluster Build System --- xlators/features/glupy/src/glupy.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/xlators/features/glupy/src/glupy.c b/xlators/features/glupy/src/glupy.c index 948b66f8d..7492124dd 100644 --- a/xlators/features/glupy/src/glupy.c +++ b/xlators/features/glupy/src/glupy.c @@ -2313,6 +2313,25 @@ get_rootunique (call_frame_t *frame) return frame->root->unique; } +int32_t +mem_acct_init (xlator_t *this) +{ + int ret = -1; + + if (!this) + return ret; + + ret = xlator_mem_acct_init (this, gf_glupy_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) { -- cgit