From fc501a57bc595ec1d65fa466cfd7d34f28f2012b Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Sat, 16 Feb 2013 22:51:10 +0530 Subject: Better mechanism to handle memory accounting Memory accounting will now be enabled if: 1) Any glusterfs process is spawned with argument --mem-accounting. 2) DEBUG is defined. Change-Id: I3345e114127a57ce61916be0e2c4e0049a4c3432 BUG: 834465 Signed-off-by: Vijay Bellur Reviewed-on: http://review.gluster.org/4523 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- libglusterfs/src/mem-pool.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/mem-pool.c b/libglusterfs/src/mem-pool.c index 755e73944..e35a599e6 100644 --- a/libglusterfs/src/mem-pool.c +++ b/libglusterfs/src/mem-pool.c @@ -33,22 +33,13 @@ void gf_mem_acct_enable_set (void *data) { - char *opt = NULL; - long val = -1; glusterfs_ctx_t *ctx = NULL; ctx = data; - if (ctx->mem_acct_enable) { - return; - } + GF_ASSERT (ctx); - opt = getenv (GLUSTERFS_ENV_MEM_ACCT_STR); - if (opt) { - val = strtol (opt, NULL, 0); - if (val) - ctx->mem_acct_enable = 1; - } + ctx->mem_acct_enable = 1; return; } -- cgit