summaryrefslogtreecommitdiff
path: root/src/ext4_dir_idx.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_dir_idx.c
parent7f35ecb424c1990684c2d1a922467f1dde69c952 (diff)
ext4: easy malloc/calloc/realloc/free substitution
Diffstat (limited to 'src/ext4_dir_idx.c')
-rw-r--r--src/ext4_dir_idx.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/ext4_dir_idx.c b/src/ext4_dir_idx.c
index 7e105af..0a89b92 100644
--- a/src/ext4_dir_idx.c
+++ b/src/ext4_dir_idx.c
@@ -939,7 +939,7 @@ static int ext4_dir_dx_split_data(struct ext4_inode_ref *inode_ref,
uint32_t block_size = ext4_sb_get_block_size(&inode_ref->fs->sb);
/* Allocate buffer for directory entries */
- uint8_t *entry_buffer = malloc(block_size);
+ uint8_t *entry_buffer = ext4_malloc(block_size);
if (entry_buffer == NULL)
return ENOMEM;
@@ -949,9 +949,9 @@ static int ext4_dir_dx_split_data(struct ext4_inode_ref *inode_ref,
/* Allocate sort entry */
struct ext4_dx_sort_entry *sort;
- sort = malloc(max_ecnt * sizeof(struct ext4_dx_sort_entry));
+ sort = ext4_malloc(max_ecnt * sizeof(struct ext4_dx_sort_entry));
if (sort == NULL) {
- free(entry_buffer);
+ ext4_free(entry_buffer);
return ENOMEM;
}
@@ -972,8 +972,8 @@ static int ext4_dir_dx_split_data(struct ext4_inode_ref *inode_ref,
rc = ext4_dir_dx_hash_string(&hinfo_tmp, len,
(char *)de->name);
if (rc != EOK) {
- free(sort);
- free(entry_buffer);
+ ext4_free(sort);
+ ext4_free(entry_buffer);
return rc;
}
@@ -1008,8 +1008,8 @@ static int ext4_dir_dx_split_data(struct ext4_inode_ref *inode_ref,
uint32_t new_iblock;
rc = ext4_fs_append_inode_dblk(inode_ref, &new_fblock, &new_iblock);
if (rc != EOK) {
- free(sort);
- free(entry_buffer);
+ ext4_free(sort);
+ ext4_free(entry_buffer);
return rc;
}
@@ -1018,8 +1018,8 @@ static int ext4_dir_dx_split_data(struct ext4_inode_ref *inode_ref,
rc = ext4_trans_block_get_noread(inode_ref->fs->bdev, &new_data_block_tmp,
new_fblock);
if (rc != EOK) {
- free(sort);
- free(entry_buffer);
+ ext4_free(sort);
+ ext4_free(entry_buffer);
return rc;
}
@@ -1097,8 +1097,8 @@ static int ext4_dir_dx_split_data(struct ext4_inode_ref *inode_ref,
ext4_trans_set_block_dirty(old_data_block->buf);
ext4_trans_set_block_dirty(new_data_block_tmp.buf);
- free(sort);
- free(entry_buffer);
+ ext4_free(sort);
+ ext4_free(entry_buffer);
ext4_dir_dx_insert_entry(inode_ref, index_block, new_hash + continued,
new_iblock);