diff options
| author | Amar Tumballi <amar@gluster.com> | 2010-06-24 07:58:51 +0000 | 
|---|---|---|
| committer | Anand V. Avati <avati@dev.gluster.com> | 2010-06-25 03:16:36 -0700 | 
| commit | 29893bcba579f7e37a6ace018ffda1c8abe45550 (patch) | |
| tree | 88cd08652635723569fb4401485e07a0460b43a5 /xlators/protocol/server/src/server.c | |
| parent | b8b2a9d2f49686d5056fb0ce6150cf9c54180b12 (diff) | |
added proper mem-types to GF_CALLOC in protocol
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 875 (Implement a new protocol to provide proper backward/forward compatibility)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=875
Diffstat (limited to 'xlators/protocol/server/src/server.c')
| -rw-r--r-- | xlators/protocol/server/src/server.c | 31 | 
1 files changed, 9 insertions, 22 deletions
diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c index b59fd513ac9..bb9edab1328 100644 --- a/xlators/protocol/server/src/server.c +++ b/xlators/protocol/server/src/server.c @@ -474,31 +474,15 @@ out:          return 0;  } -static int32_t -mem_acct_init (xlator_t *this) -{ -        int     ret = -1; - -        if (!this) -                return ret; - -        ret = xlator_mem_acct_init (this, gf_server_mt_end + 1); - -        if (ret != 0) { -                gf_log (this->name, GF_LOG_ERROR, "Memory accounting init" -                                "failed"); -                return ret; -        } - -        return ret; -} -  int  init (xlator_t *this)  {          int32_t        ret = -1;          server_conf_t *conf = NULL; +        if (!this) +                goto out; +          if (this->children == NULL) {                  gf_log (this->name, GF_LOG_ERROR,                          "protocol/server should have subvolume"); @@ -511,11 +495,14 @@ init (xlator_t *this)                  goto out;          } -        ret = mem_acct_init (this); -        if (ret) +        ret = xlator_mem_acct_init (this, gf_server_mt_end + 1); +        if (ret) { +                gf_log (this->name, GF_LOG_ERROR, +                        "Failed to Initialize memory accounting");                  goto out; +        } -        conf = GF_CALLOC (1, sizeof (server_conf_t), 0); +        conf = GF_CALLOC (1, sizeof (server_conf_t), gf_server_mt_server_conf_t);          GF_VALIDATE_OR_GOTO(this->name, conf, out);          INIT_LIST_HEAD (&conf->conns);  | 
