summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/ha/src/ha.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/ha/src/ha.c')
-rw-r--r--xlators/cluster/ha/src/ha.c212
1 files changed, 113 insertions, 99 deletions
diff --git a/xlators/cluster/ha/src/ha.c b/xlators/cluster/ha/src/ha.c
index 3317ae783..3eccb516b 100644
--- a/xlators/cluster/ha/src/ha.c
+++ b/xlators/cluster/ha/src/ha.c
@@ -1,22 +1,12 @@
/*
- Copyright (c) 2008-2009 Gluster, Inc. <http://www.gluster.com>
- This file is part of GlusterFS.
-
- GlusterFS is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 3 of the License,
- or (at your option) any later version.
-
- GlusterFS is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see
- <http://www.gnu.org/licenses/>.
-*/
+ Copyright (c) 2008-2012 Red Hat, Inc. <http://www.redhat.com>
+ This file is part of GlusterFS.
+ This file is licensed to you under your choice of the GNU Lesser
+ General Public License, version 3 or any later version (LGPLv3 or
+ later), or the GNU General Public License, version 2 (GPLv2), in all
+ cases as published by the Free Software Foundation.
+*/
/* generate errors randomly, code is simple now, better alogorithm
* can be written to decide what error to be returned and when
*/
@@ -50,7 +40,7 @@ ha_local_wipe (ha_local_t *local)
}
if (local->state) {
- FREE (local->state);
+ GF_FREE (local->state);
local->state = NULL;
}
@@ -71,7 +61,7 @@ ha_local_wipe (ha_local_t *local)
local->inode = NULL;
}
- FREE (local);
+ GF_FREE (local);
return;
}
@@ -84,7 +74,7 @@ ha_forget (xlator_t *this,
char *state = NULL;
if (!inode_ctx_del (inode, this, &stateino)) {
state = ((char *)(long)stateino);
- FREE (state);
+ GF_FREE (state);
}
return 0;
@@ -193,7 +183,8 @@ ha_lookup (call_frame_t *frame,
child_count = pvt->child_count;
children = pvt->children;
- frame->local = local = CALLOC (1, sizeof (*local));
+ frame->local = local = GF_CALLOC (1, sizeof (*local),
+ gf_ha_mt_ha_local_t);
if (!local) {
gf_log (this->name, GF_LOG_ERROR, "out of memory");
op_errno = ENOMEM;
@@ -205,7 +196,7 @@ ha_lookup (call_frame_t *frame,
ret = inode_ctx_get (loc->inode, this, NULL);
if (ret) {
- state = CALLOC (1, child_count);
+ state = GF_CALLOC (1, child_count, gf_ha_mt_child_count);
if (state == NULL) {
gf_log (this->name, GF_LOG_ERROR, "out of memory");
op_errno = ENOMEM;
@@ -645,7 +636,7 @@ ha_mknod_lookup_cbk (call_frame_t *frame,
if (cnt == 0) {
call_stub_t *stub = local->stub;
- FREE (local->state);
+ GF_FREE (local->state);
STACK_UNWIND (frame,
local->op_ret,
local->op_errno,
@@ -715,7 +706,7 @@ ha_mknod_cbk (call_frame_t *frame,
if (cnt == 0 || i == child_count) {
call_stub_t *stub = local->stub;
- FREE (local->state);
+ GF_FREE (local->state);
stub = local->stub;
STACK_UNWIND (frame, local->op_ret, local->op_errno,
local->stub->args.mknod.loc.inode, &local->buf,
@@ -770,7 +761,8 @@ ha_mknod (call_frame_t *frame,
pvt = this->private;
child_count = pvt->child_count;
- frame->local = local = CALLOC (1, sizeof (*local));
+ frame->local = local = GF_CALLOC (1, sizeof (*local),
+ gf_ha_mt_ha_local_t);
if (!local) {
gf_log (this->name, GF_LOG_ERROR, "out of memory");
op_errno = ENOMEM;
@@ -786,7 +778,7 @@ ha_mknod (call_frame_t *frame,
local->op_ret = -1;
local->op_errno = ENOTCONN;
- local->state = CALLOC (1, child_count);
+ local->state = GF_CALLOC (1, child_count, gf_ha_mt_char);
if (!local->state) {
gf_log (this->name, GF_LOG_ERROR, "out of memory");
op_errno = ENOMEM;
@@ -796,7 +788,7 @@ ha_mknod (call_frame_t *frame,
memcpy (local->state, pvt->state, child_count);
local->active = -1;
- stateino = CALLOC (1, child_count);
+ stateino = GF_CALLOC (1, child_count, gf_ha_mt_char);
if (!stateino) {
gf_log (this->name, GF_LOG_ERROR, "out of memory");
op_errno = ENOMEM;
@@ -875,7 +867,7 @@ ha_mkdir_lookup_cbk (call_frame_t *frame,
if (cnt == 0) {
call_stub_t *stub = local->stub;
- FREE (local->state);
+ GF_FREE (local->state);
STACK_UNWIND (frame,
local->op_ret,
local->op_errno,
@@ -940,7 +932,7 @@ ha_mkdir_cbk (call_frame_t *frame,
if (cnt == 0 || i == child_count) {
call_stub_t *stub = local->stub;
- FREE (local->state);
+ GF_FREE (local->state);
stub = local->stub;
STACK_UNWIND (frame, local->op_ret, local->op_errno,
local->stub->args.mkdir.loc.inode, &local->buf,
@@ -993,7 +985,8 @@ ha_mkdir (call_frame_t *frame,
pvt = this->private;
child_count = pvt->child_count;
- frame->local = local = CALLOC (1, sizeof (*local));
+ frame->local = local = GF_CALLOC (1, sizeof (*local),
+ gf_ha_mt_ha_local_t);
if (!frame->local) {
gf_log (this->name, GF_LOG_ERROR, "out of memory");
op_errno = ENOMEM;
@@ -1009,7 +1002,7 @@ ha_mkdir (call_frame_t *frame,
local->op_ret = -1;
local->op_errno = ENOTCONN;
- local->state = CALLOC (1, child_count);
+ local->state = GF_CALLOC (1, child_count, gf_ha_mt_char);
if (!local->state) {
gf_log (this->name, GF_LOG_ERROR, "out of memory");
op_errno = ENOMEM;
@@ -1019,7 +1012,7 @@ ha_mkdir (call_frame_t *frame,
memcpy (local->state, pvt->state, child_count);
local->active = -1;
- stateino = CALLOC (1, child_count);
+ stateino = GF_CALLOC (1, child_count, gf_ha_mt_char);
if (!stateino) {
gf_log (this->name, GF_LOG_ERROR, "out of memory");
op_errno = ENOMEM;
@@ -1204,7 +1197,7 @@ ha_symlink_lookup_cbk (call_frame_t *frame,
if (cnt == 0) {
call_stub_t *stub = local->stub;
- FREE (local->state);
+ GF_FREE (local->state);
STACK_UNWIND (frame,
local->op_ret,
local->op_errno,
@@ -1268,7 +1261,7 @@ ha_symlink_cbk (call_frame_t *frame,
if (cnt == 0 || i == child_count) {
call_stub_t *stub = local->stub;
- FREE (local->state);
+ GF_FREE (local->state);
stub = local->stub;
STACK_UNWIND (frame, local->op_ret, local->op_errno,
local->stub->args.symlink.loc.inode, &local->buf,
@@ -1321,7 +1314,8 @@ ha_symlink (call_frame_t *frame,
pvt = this->private;
child_count = pvt->child_count;
- frame->local = local = CALLOC (1, sizeof (*local));
+ frame->local = local = GF_CALLOC (1, sizeof (*local),
+ gf_ha_mt_ha_local_t);
if (!local) {
op_errno = ENOMEM;
gf_log (this->name, GF_LOG_ERROR, "out of memory");
@@ -1337,7 +1331,7 @@ ha_symlink (call_frame_t *frame,
local->op_ret = -1;
local->op_errno = ENOTCONN;
- local->state = CALLOC (1, child_count);
+ local->state = GF_CALLOC (1, child_count, gf_ha_mt_char);
if (!local->state) {
op_errno = ENOMEM;
gf_log (this->name, GF_LOG_ERROR, "out of memory");
@@ -1347,7 +1341,7 @@ ha_symlink (call_frame_t *frame,
memcpy (local->state, pvt->state, child_count);
local->active = -1;
- stateino = CALLOC (1, child_count);
+ stateino = GF_CALLOC (1, child_count, gf_ha_mt_char);
if (!stateino) {
op_errno = ENOMEM;
gf_log (this->name, GF_LOG_ERROR, "out of memory");
@@ -1481,7 +1475,7 @@ ha_link_lookup_cbk (call_frame_t *frame,
if (cnt == 0) {
call_stub_t *stub = local->stub;
- FREE (local->state);
+ GF_FREE (local->state);
STACK_UNWIND (frame,
local->op_ret,
local->op_errno,
@@ -1545,7 +1539,7 @@ ha_link_cbk (call_frame_t *frame,
if (cnt == 0 || i == child_count) {
call_stub_t *stub = local->stub;
- FREE (local->state);
+ GF_FREE (local->state);
stub = local->stub;
STACK_UNWIND (frame, local->op_ret, local->op_errno,
local->stub->args.link.oldloc.inode, &local->buf,
@@ -1613,7 +1607,8 @@ ha_link (call_frame_t *frame,
pvt = this->private;
child_count = pvt->child_count;
- frame->local = local = CALLOC (1, sizeof (*local));
+ frame->local = local = GF_CALLOC (1, sizeof (*local),
+ gf_ha_mt_ha_local_t);
if (!frame->local) {
gf_log (this->name, GF_LOG_ERROR, "out of memory");
op_errno = ENOMEM;
@@ -1629,7 +1624,7 @@ ha_link (call_frame_t *frame,
local->op_ret = -1;
local->op_errno = ENOTCONN;
- local->state = CALLOC (1, child_count);
+ local->state = GF_CALLOC (1, child_count, gf_ha_mt_char);
if (!local->state) {
gf_log (this->name, GF_LOG_ERROR, "out of memory");
op_errno = ENOMEM;
@@ -1741,7 +1736,7 @@ ha_create_cbk (call_frame_t *frame,
stub->args.create.fd,
stub->args.create.loc.inode, &local->buf,
&local->preparent, &local->postparent);
- FREE (state);
+ GF_FREE (state);
call_stub_destroy (stub);
return 0;
}
@@ -1785,7 +1780,8 @@ ha_create (call_frame_t *frame,
children = pvt->children;
if (local == NULL) {
- local = frame->local = CALLOC (1, sizeof (*local));
+ frame->local = local = GF_CALLOC (1, sizeof (*local),
+ gf_ha_mt_ha_local_t);
if (!local) {
op_errno = ENOMEM;
gf_log (this->name, GF_LOG_ERROR, "out of memory");
@@ -1799,7 +1795,7 @@ ha_create (call_frame_t *frame,
goto err;
}
- local->state = CALLOC (1, child_count);
+ local->state = GF_CALLOC (1, child_count, gf_ha_mt_char);
if (!local->state) {
op_errno = ENOMEM;
gf_log (this->name, GF_LOG_ERROR, "out of memory");
@@ -1819,28 +1815,28 @@ ha_create (call_frame_t *frame,
}
}
/* FIXME handle active -1 */
- stateino = CALLOC (1, child_count);
+ stateino = GF_CALLOC (1, child_count, gf_ha_mt_char);
if (!stateino) {
op_errno = ENOMEM;
gf_log (this->name, GF_LOG_ERROR, "out of memory");
goto err;
}
- hafdp = CALLOC (1, sizeof (*hafdp));
+ hafdp = GF_CALLOC (1, sizeof (*hafdp), gf_ha_mt_hafd_t);
if (!hafdp) {
op_errno = ENOMEM;
gf_log (this->name, GF_LOG_ERROR, "out of memory");
goto err;
}
- hafdp->fdstate = CALLOC (1, child_count);
+ hafdp->fdstate = GF_CALLOC (1, child_count, gf_ha_mt_char);
if (!hafdp->fdstate) {
op_errno = ENOMEM;
gf_log (this->name, GF_LOG_ERROR, "out of memory");
goto err;
}
- hafdp->path = strdup(loc->path);
+ hafdp->path = gf_strdup(loc->path);
if (!hafdp->path) {
op_errno = ENOMEM;
gf_log (this->name, GF_LOG_ERROR, "out of memory");
@@ -1865,20 +1861,16 @@ err:
ha_local_wipe (local);
if (stateino) {
- FREE (stateino);
+ GF_FREE (stateino);
stateino = NULL;
}
if (hafdp) {
- if (hafdp->fdstate) {
- FREE (hafdp->fdstate);
- }
+ GF_FREE (hafdp->fdstate);
- if (hafdp->path) {
- FREE (hafdp->path);
- }
+ GF_FREE (hafdp->path);
- FREE (hafdp);
+ GF_FREE (hafdp);
}
return 0;
@@ -1955,7 +1947,8 @@ ha_open (call_frame_t *frame,
child_count = pvt->child_count;
- local = frame->local = CALLOC (1, sizeof (*local));
+ frame->local = local = GF_CALLOC (1, sizeof (*local),
+ gf_ha_mt_ha_local_t);
if (!local) {
op_errno = ENOMEM;
gf_log (this->name, GF_LOG_ERROR, "out of memory");
@@ -1966,21 +1959,21 @@ ha_open (call_frame_t *frame,
local->op_errno = ENOTCONN;
local->fd = fd;
- hafdp = CALLOC (1, sizeof (*hafdp));
+ hafdp = GF_CALLOC (1, sizeof (*hafdp), gf_ha_mt_hafd_t);
if (!hafdp) {
op_errno = ENOMEM;
gf_log (this->name, GF_LOG_ERROR, "out of memory");
goto err;
}
- hafdp->fdstate = CALLOC (1, child_count);
+ hafdp->fdstate = GF_CALLOC (1, child_count, gf_ha_mt_char);
if (!hafdp->fdstate) {
op_errno = ENOMEM;
gf_log (this->name, GF_LOG_ERROR, "out of memory");
goto err;
}
- hafdp->path = strdup (loc->path);
+ hafdp->path = gf_strdup (loc->path);
if (!hafdp->path) {
op_errno = ENOMEM;
gf_log (this->name, GF_LOG_ERROR, "out of memory");
@@ -2020,16 +2013,16 @@ err:
STACK_UNWIND (frame, -1, op_errno, fd);
if (hafdp) {
if (hafdp->fdstate) {
- FREE (hafdp->fdstate);
+ GF_FREE (hafdp->fdstate);
hafdp->fdstate = NULL;
}
if (hafdp->path) {
- FREE (hafdp->path);
+ GF_FREE (hafdp->path);
hafdp->path = NULL;
}
- FREE (hafdp);
+ GF_FREE (hafdp);
}
ha_local_wipe (local);
@@ -2420,7 +2413,8 @@ ha_opendir (call_frame_t *frame,
children = pvt->children;
child_count = pvt->child_count;
- local = frame->local = CALLOC (1, sizeof (*local));
+ frame->local = local = GF_CALLOC (1, sizeof (*local),
+ gf_ha_mt_ha_local_t);
if (!local) {
op_errno = ENOMEM;
gf_log (this->name, GF_LOG_ERROR, "out of memory");
@@ -2431,21 +2425,21 @@ ha_opendir (call_frame_t *frame,
local->op_errno = ENOTCONN;
local->fd = fd;
- hafdp = CALLOC (1, sizeof (*hafdp));
+ hafdp = GF_CALLOC (1, sizeof (*hafdp), gf_ha_mt_hafd_t);
if (!hafdp) {
op_errno = ENOMEM;
gf_log (this->name, GF_LOG_ERROR, "out of memory");
goto err;
}
- hafdp->fdstate = CALLOC (1, child_count);
+ hafdp->fdstate = GF_CALLOC (1, child_count, gf_ha_mt_char);
if (!hafdp->fdstate) {
op_errno = ENOMEM;
gf_log (this->name, GF_LOG_ERROR, "out of memory");
goto err;
}
- hafdp->path = strdup (loc->path);
+ hafdp->path = gf_strdup (loc->path);
if (!hafdp->path) {
op_errno = ENOMEM;
gf_log (this->name, GF_LOG_ERROR, "out of memory");
@@ -2484,16 +2478,16 @@ err:
ha_local_wipe (local);
if (hafdp) {
if (hafdp->fdstate) {
- FREE (hafdp->fdstate);
+ GF_FREE (hafdp->fdstate);
hafdp->fdstate = NULL;
}
if (hafdp->path) {
- FREE (hafdp->path);
+ GF_FREE (hafdp->path);
hafdp->path = NULL;
}
- FREE (hafdp);
+ GF_FREE (hafdp);
}
return 0;
}
@@ -2733,7 +2727,8 @@ ha_statfs (call_frame_t *frame,
/* The normal way of handling failover doesn't work here
* as loc->inode may be null in this case.
*/
- local = CALLOC (1, sizeof (*local));
+ local = GF_CALLOC (1, sizeof (*local),
+ gf_ha_mt_ha_local_t);
if (!local) {
op_errno = ENOMEM;
goto err;
@@ -3057,7 +3052,7 @@ ha_lk_setlk_unlck_cbk (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct flock *lock)
+ struct gf_flock *lock)
{
ha_local_t *local = NULL;
int cnt = 0;
@@ -3073,7 +3068,7 @@ ha_lk_setlk_unlck_cbk (call_frame_t *frame,
if (cnt == 0) {
stub = local->stub;
- FREE (local->state);
+ GF_FREE (local->state);
if (stub->args.lk.lock.l_type == F_UNLCK) {
STACK_UNWIND (frame, local->op_ret, local->op_errno, &stub->args.lk.lock);
} else {
@@ -3090,7 +3085,7 @@ ha_lk_setlk_cbk (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct flock *lock)
+ struct gf_flock *lock)
{
ha_local_t *local = NULL;
ha_private_t *pvt = NULL;
@@ -3122,7 +3117,7 @@ ha_lk_setlk_cbk (call_frame_t *frame,
}
if (i == child_count) {
call_stub_t *stub = local->stub;
- FREE (local->state);
+ GF_FREE (local->state);
STACK_UNWIND (frame, 0, op_errno, &stub->args.lk.lock);
call_stub_destroy (stub);
return 0;
@@ -3146,7 +3141,7 @@ ha_lk_setlk_cbk (call_frame_t *frame,
cnt++;
}
if (cnt) {
- struct flock lock;
+ struct gf_flock lock;
lock = local->stub->args.lk.lock;
for (i = 0; i < child_count; i++) {
if (state[i]) {
@@ -3163,7 +3158,7 @@ ha_lk_setlk_cbk (call_frame_t *frame,
}
return 0;
} else {
- FREE (local->state);
+ GF_FREE (local->state);
call_stub_destroy (local->stub);
STACK_UNWIND (frame,
op_ret,
@@ -3180,7 +3175,7 @@ ha_lk_getlk_cbk (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct flock *lock)
+ struct gf_flock *lock)
{
ha_local_t *local = NULL;
ha_private_t *pvt = NULL;
@@ -3197,7 +3192,7 @@ ha_lk_getlk_cbk (call_frame_t *frame,
prev_frame = cookie;
if (op_ret == 0) {
- FREE (local->state);
+ GF_FREE (local->state);
call_stub_destroy (local->stub);
STACK_UNWIND (frame, 0, 0, lock);
return 0;
@@ -3214,7 +3209,7 @@ ha_lk_getlk_cbk (call_frame_t *frame,
}
if (i == child_count) {
- FREE (local->state);
+ GF_FREE (local->state);
call_stub_destroy (local->stub);
STACK_UNWIND (frame, op_ret, op_errno, lock);
return 0;
@@ -3235,7 +3230,7 @@ ha_lk (call_frame_t *frame,
xlator_t *this,
fd_t *fd,
int32_t cmd,
- struct flock *lock)
+ struct gf_flock *lock)
{
ha_local_t *local = NULL;
ha_private_t *pvt = NULL;
@@ -3255,7 +3250,8 @@ ha_lk (call_frame_t *frame,
gf_log (this->name, GF_LOG_ERROR, "fd_ctx_get failed");
if (local == NULL) {
- local = frame->local = CALLOC (1, sizeof (*local));
+ local = frame->local = GF_CALLOC (1, sizeof (*local),
+ gf_ha_mt_ha_local_t);
if (!local) {
op_errno = ENOMEM;
gf_log (this->name, GF_LOG_ERROR, "out of memory");
@@ -3280,7 +3276,7 @@ ha_lk (call_frame_t *frame,
goto err;
}
- local->state = CALLOC (1, child_count);
+ local->state = GF_CALLOC (1, child_count, gf_ha_mt_char);
if (!local->state) {
op_errno = ENOMEM;
gf_log (this->name, GF_LOG_ERROR, "out of memory");
@@ -3368,7 +3364,7 @@ ha_inodelk (call_frame_t *frame,
const char *volume,
loc_t *loc,
int32_t cmd,
- struct flock *lock)
+ struct gf_flock *lock)
{
ha_local_t *local = NULL;
int op_errno = 0;
@@ -3636,7 +3632,8 @@ ha_stats (call_frame_t *frame,
int i = 0;
int32_t op_errno = EINVAL;
- local = frame->local = CALLOC (1, sizeof (*local));
+ local = frame->local = GF_CALLOC (1, sizeof (*local),
+ gf_ha_mt_ha_local_t);
if (!local) {
op_errno = ENOMEM;
gf_log (this->name, GF_LOG_ERROR, "out of memory");
@@ -3737,7 +3734,8 @@ ha_getspec (call_frame_t *frame,
int i = 0;
int32_t op_errno = EINVAL;
- local = frame->local = CALLOC (1, sizeof (*local));
+ local = frame->local = GF_CALLOC (1, sizeof (*local),
+ gf_ha_mt_ha_local_t);
if (!local) {
op_errno = ENOMEM;
gf_log (this->name, GF_LOG_ERROR, "out of memory");
@@ -3791,8 +3789,8 @@ ha_closedir (xlator_t *this,
}
hafdp = (hafd_t *)(long)tmp_hafdp;
- FREE (hafdp->fdstate);
- FREE (hafdp->path);
+ GF_FREE (hafdp->fdstate);
+ GF_FREE (hafdp->path);
LOCK_DESTROY (&hafdp->lock);
return 0;
}
@@ -3812,8 +3810,8 @@ ha_close (xlator_t *this,
}
hafdp = (hafd_t *)(long)tmp_hafdp;
- FREE (hafdp->fdstate);
- FREE (hafdp->path);
+ GF_FREE (hafdp->fdstate);
+ GF_FREE (hafdp->path);
LOCK_DESTROY (&hafdp->lock);
return 0;
}
@@ -3884,6 +3882,25 @@ notify (xlator_t *this,
return 0;
}
+int32_t
+mem_acct_init (xlator_t *this)
+{
+ int ret = -1;
+
+ if (!this)
+ return ret;
+
+ ret = xlator_mem_acct_init (this, gf_ha_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)
{
@@ -3891,6 +3908,7 @@ init (xlator_t *this)
xlator_list_t *trav = NULL;
int count = 0, ret = 0;
+
if (!this->children) {
gf_log (this->name,GF_LOG_ERROR,
"FATAL: ha should have one or more child defined");
@@ -3903,7 +3921,7 @@ init (xlator_t *this)
}
trav = this->children;
- pvt = CALLOC (1, sizeof (ha_private_t));
+ pvt = GF_CALLOC (1, sizeof (ha_private_t), gf_ha_mt_ha_private_t);
ret = dict_get_int32 (this->options, "preferred-subvolume",
&pvt->pref_subvol);
@@ -3918,7 +3936,8 @@ init (xlator_t *this)
}
pvt->child_count = count;
- pvt->children = CALLOC (count, sizeof (xlator_t*));
+ pvt->children = GF_CALLOC (count, sizeof (xlator_t*),
+ gf_ha_mt_xlator_t);
trav = this->children;
count = 0;
@@ -3928,7 +3947,7 @@ init (xlator_t *this)
trav = trav->next;
}
- pvt->state = CALLOC (1, count);
+ pvt->state = GF_CALLOC (1, count, gf_ha_mt_char);
this->private = pvt;
return 0;
}
@@ -3938,7 +3957,7 @@ fini (xlator_t *this)
{
ha_private_t *priv = NULL;
priv = this->private;
- FREE (priv);
+ GF_FREE (priv);
return;
}
@@ -3983,11 +4002,6 @@ struct xlator_fops fops = {
.fsetattr = ha_fsetattr,
};
-struct xlator_mops mops = {
- .stats = ha_stats,
- .getspec = ha_getspec,
-};
-
struct xlator_cbks cbks = {
.release = ha_close,
.releasedir = ha_closedir,