summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server/src/server-resolve.c
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2010-04-22 13:33:09 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-04-23 06:32:52 -0700
commit582de0677da4be19fc6f873625c58c45d069ab1c (patch)
treef10cb3e26e1f92f6ea91034e6f7bb925790dd9bc /xlators/protocol/server/src/server-resolve.c
parent72baa17282f5cf749fa743fd601c7b728ece4fa2 (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 'xlators/protocol/server/src/server-resolve.c')
-rw-r--r--xlators/protocol/server/src/server-resolve.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/xlators/protocol/server/src/server-resolve.c b/xlators/protocol/server/src/server-resolve.c
index f4c9ebad7..00f1728c5 100644
--- a/xlators/protocol/server/src/server-resolve.c
+++ b/xlators/protocol/server/src/server-resolve.c
@@ -69,11 +69,12 @@ prepare_components (call_frame_t *frame)
this = frame->this;
resolve = state->resolve_now;
- resolved = strdup (resolve->path);
+ resolved = gf_strdup (resolve->path);
resolve->resolved = resolved;
count = component_count (resolve->path);
- components = CALLOC (sizeof (*components), count);
+ components = GF_CALLOC (sizeof (*components), count,
+ gf_server_mt_resolve_comp);
resolve->components = components;
components[0].basename = "";
@@ -116,7 +117,7 @@ resolve_loc_touchup (call_frame_t *frame)
}
if (!path)
- path = strdup (resolve->path);
+ path = gf_strdup (resolve->path);
loc->path = path;
}
@@ -205,7 +206,7 @@ resolve_deep_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
/* join the current component with the path resolved until now */
*(components[i].basename - 1) = '/';
- resolve->deep_loc.path = strdup (resolve->resolved);
+ resolve->deep_loc.path = gf_strdup (resolve->resolved);
resolve->deep_loc.parent = inode_ref (components[i-1].inode);
resolve->deep_loc.inode = inode_new (state->itable);
resolve->deep_loc.name = components[i].basename;
@@ -241,7 +242,7 @@ resolve_path_deep (call_frame_t *frame)
/* start from the root */
resolve->deep_loc.inode = state->itable->root;
- resolve->deep_loc.path = strdup ("/");
+ resolve->deep_loc.path = gf_strdup ("/");
resolve->deep_loc.name = "";
STACK_WIND_COOKIE (frame, resolve_deep_cbk, (void *) (long) i,