summaryrefslogtreecommitdiff
path: root/src/ext4_extent.c
diff options
context:
space:
mode:
authorMichał Majewicz <mmajewicz@users.noreply.github.com>2016-08-19 10:41:47 +0200
committerMichał Majewicz <mmajewicz@users.noreply.github.com>2016-08-19 11:49:59 +0200
commit2577ef35e81f7e8064cf8dd5c23c44efe1407dc5 (patch)
tree8e67b4ea30113f511189afc06f344916c32b9dbd /src/ext4_extent.c
parent7f35ecb424c1990684c2d1a922467f1dde69c952 (diff)
ext4: easy malloc/calloc/realloc/free substitution
Diffstat (limited to 'src/ext4_extent.c')
-rw-r--r--src/ext4_extent.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/ext4_extent.c b/src/ext4_extent.c
index 67871cf..28db853 100644
--- a/src/ext4_extent.c
+++ b/src/ext4_extent.c
@@ -529,14 +529,14 @@ static int ext4_find_extent(struct ext4_inode_ref *inode_ref, ext4_lblk_t block,
if (path) {
ext4_ext_drop_refs(inode_ref, path, 0);
if (depth > path[0].maxdepth) {
- free(path);
+ ext4_free(path);
*orig_path = path = NULL;
}
}
if (!path) {
int32_t path_depth = depth + 1;
/* account possible depth increase */
- path = calloc(1, sizeof(struct ext4_extent_path) *
+ path = ext4_calloc(1, sizeof(struct ext4_extent_path) *
(path_depth + 1));
if (!path)
return ENOMEM;
@@ -592,7 +592,7 @@ static int ext4_find_extent(struct ext4_inode_ref *inode_ref, ext4_lblk_t block,
err:
ext4_ext_drop_refs(inode_ref, path, 0);
- free(path);
+ ext4_free(path);
if (orig_path)
*orig_path = NULL;
return ret;
@@ -1130,7 +1130,7 @@ again:
i = depth - (level - 1);
/* We split from leaf to the i-th node */
if (level > 0) {
- npath = calloc(1, sizeof(struct ext4_extent_path) *
+ npath = ext4_calloc(1, sizeof(struct ext4_extent_path) *
(level));
if (!npath) {
ret = ENOMEM;
@@ -1168,7 +1168,7 @@ out:
}
}
if (npath)
- free(npath);
+ ext4_free(npath);
return ret;
}
@@ -1498,7 +1498,7 @@ int ext4_extent_remove_space(struct ext4_inode_ref *inode_ref, ext4_lblk_t from,
out:
ext4_ext_drop_refs(inode_ref, path, 0);
- free(path);
+ ext4_free(path);
path = NULL;
return ret;
}
@@ -1792,7 +1792,7 @@ out:
out2:
if (path) {
ext4_ext_drop_refs(inode_ref, path, 0);
- free(path);
+ ext4_free(path);
}
return err;