gfapi: fix mem-types initialisation
... and also fill the body of mem_acct_init(). Change-Id: I457d0629c20f999dd2f50e710c75b1c7575b6c19 BUG: 1021904 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/6134 Reviewed-by: Amar Tumballi <amarts@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
This commit is contained in:
parent
3033d9c7b4
commit
93c49c6e8c
@ -24,6 +24,7 @@
|
||||
#include "glusterfs.h"
|
||||
|
||||
#include "glfs-internal.h"
|
||||
#include "glfs-mem-types.h"
|
||||
|
||||
|
||||
int
|
||||
@ -114,6 +115,18 @@ notify (xlator_t *this, int event, void *data, ...)
|
||||
int
|
||||
mem_acct_init (xlator_t *this)
|
||||
{
|
||||
int ret = -1;
|
||||
|
||||
if (!this)
|
||||
return ret;
|
||||
|
||||
ret = xlator_mem_acct_init (this, glfs_mt_end + 1);
|
||||
if (ret) {
|
||||
gf_log (this->name, GF_LOG_ERROR, "Failed to initialise "
|
||||
"memory accounting");
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
#define GF_MEM_TYPE_START (gf_common_mt_end + 1)
|
||||
|
||||
enum glfs_mem_types_ {
|
||||
glfs_mt_glfs_t,
|
||||
glfs_mt_glfs_t = GF_MEM_TYPE_START,
|
||||
glfs_mt_call_pool_t,
|
||||
glfs_mt_xlator_t,
|
||||
glfs_mt_glfs_fd_t,
|
||||
|
@ -66,7 +66,7 @@ glusterfs_ctx_defaults_init (glusterfs_ctx_t *ctx)
|
||||
call_pool_t *pool = NULL;
|
||||
int ret = -1;
|
||||
|
||||
xlator_mem_acct_init (THIS, glfs_mt_end);
|
||||
xlator_mem_acct_init (THIS, glfs_mt_end + 1);
|
||||
|
||||
ctx->process_uuid = generate_glusterfs_ctx_id ();
|
||||
if (!ctx->process_uuid) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user