diff options
author | Vijay Bellur <vijay@gluster.com> | 2010-04-22 13:33:09 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-04-23 06:32:52 -0700 |
commit | 582de0677da4be19fc6f873625c58c45d069ab1c (patch) | |
tree | f10cb3e26e1f92f6ea91034e6f7bb925790dd9bc /scheduler/rr/src/rr.c | |
parent | 72baa17282f5cf749fa743fd601c7b728ece4fa2 (diff) |
Memory accounting changes
Memory accounting Changes. Thanks to Vinayak Hegde and Csaba Henk for their
contributions.
Signed-off-by: Vijay Bellur <vijay@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 329 (Replacing memory allocation functions with mem-type functions)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=329
Diffstat (limited to 'scheduler/rr/src/rr.c')
-rw-r--r-- | scheduler/rr/src/rr.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/scheduler/rr/src/rr.c b/scheduler/rr/src/rr.c index d47f87278..83a0f267f 100644 --- a/scheduler/rr/src/rr.c +++ b/scheduler/rr/src/rr.c @@ -31,6 +31,7 @@ #include "rr-options.h" #include "rr.h" +#include "rr-mem-types.h" #define RR_MIN_FREE_DISK_NOT_REACHED 0 #define RR_MIN_FREE_DISK_REACHED 1 @@ -58,14 +59,14 @@ _cleanup_rr (rr_t *rr) { for (i = 0; i < rr->options.read_only_subvolume_count; i++) { - free (rr->options.read_only_subvolume_list[i]); + GF_FREE (rr->options.read_only_subvolume_list[i]); } - free (rr->options.read_only_subvolume_list); + GF_FREE (rr->options.read_only_subvolume_list); } - free (rr->subvolume_list); + GF_FREE (rr->subvolume_list); - free (rr); + GF_FREE (rr); return 0; } @@ -95,14 +96,14 @@ rr_init (xlator_t *this_xl) return -1; } - if ((rr = CALLOC (1, sizeof (rr_t))) == NULL) + if ((rr = GF_CALLOC (1, sizeof (rr_t), gf_rr_mt_rr_t)) == NULL) { return -1; } if (rr_options_validate (options, &rr->options) != 0) { - free (rr); + GF_FREE (rr); return -1; } @@ -147,8 +148,9 @@ rr_init (xlator_t *this_xl) return -1; } - if ((rr->subvolume_list = CALLOC (rr->subvolume_count, - sizeof (rr_subvolume_t))) == NULL) + if ((rr->subvolume_list = GF_CALLOC (rr->subvolume_count, + sizeof (rr_subvolume_t), + gf_rr_mt_rr_subvolume_t)) == NULL) { _cleanup_rr (rr); return -1; @@ -476,7 +478,7 @@ rr_notify (xlator_t *this_xl, int32_t event, void *data) if (xattr) dict_ref (xattr); - loc.path = strdup ("/"); + loc.path = gf_strdup ("/"); for (trav = this_xl->parents->xlator; trav; trav = trav->parents->xlator) { if (trav->itable) { loc.inode = trav->itable->root; |