diff options
author | Avantika Mathur <mathur@us.ibm.com> | 2006-12-06 23:41:35 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 11:39:48 -0500 |
commit | 5d4958f923f431e148d9ba8ff894209a134b943e (patch) | |
tree | b23c443fa3047ec02c7ff3527bcb1a76caa97a05 /fs/ext4 | |
parent | 7e0289766a0750a56260565bd3b74eb544483d45 (diff) |
[PATCH] ext4: kmalloc to kzalloc
Performs kmalloc to kzalloc conversion
Signed-off-by: Avantika Mathur <mathur@us.ibm.com>
Cc: <linux-ext4@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/extents.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 06ce8e87731e..e41be1866d7d 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c | |||
@@ -477,13 +477,12 @@ ext4_ext_find_extent(struct inode *inode, int block, struct ext4_ext_path *path) | |||
477 | 477 | ||
478 | /* account possible depth increase */ | 478 | /* account possible depth increase */ |
479 | if (!path) { | 479 | if (!path) { |
480 | path = kmalloc(sizeof(struct ext4_ext_path) * (depth + 2), | 480 | path = kzalloc(sizeof(struct ext4_ext_path) * (depth + 2), |
481 | GFP_NOFS); | 481 | GFP_NOFS); |
482 | if (!path) | 482 | if (!path) |
483 | return ERR_PTR(-ENOMEM); | 483 | return ERR_PTR(-ENOMEM); |
484 | alloc = 1; | 484 | alloc = 1; |
485 | } | 485 | } |
486 | memset(path, 0, sizeof(struct ext4_ext_path) * (depth + 1)); | ||
487 | path[0].p_hdr = eh; | 486 | path[0].p_hdr = eh; |
488 | 487 | ||
489 | /* walk through the tree */ | 488 | /* walk through the tree */ |
@@ -643,10 +642,9 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode, | |||
643 | * We need this to handle errors and free blocks | 642 | * We need this to handle errors and free blocks |
644 | * upon them. | 643 | * upon them. |
645 | */ | 644 | */ |
646 | ablocks = kmalloc(sizeof(ext4_fsblk_t) * depth, GFP_NOFS); | 645 | ablocks = kzalloc(sizeof(ext4_fsblk_t) * depth, GFP_NOFS); |
647 | if (!ablocks) | 646 | if (!ablocks) |
648 | return -ENOMEM; | 647 | return -ENOMEM; |
649 | memset(ablocks, 0, sizeof(ext4_fsblk_t) * depth); | ||
650 | 648 | ||
651 | /* allocate all needed blocks */ | 649 | /* allocate all needed blocks */ |
652 | ext_debug("allocate %d blocks for indexes/leaf\n", depth - at); | 650 | ext_debug("allocate %d blocks for indexes/leaf\n", depth - at); |
@@ -1773,12 +1771,11 @@ int ext4_ext_remove_space(struct inode *inode, unsigned long start) | |||
1773 | * We start scanning from right side, freeing all the blocks | 1771 | * We start scanning from right side, freeing all the blocks |
1774 | * after i_size and walking into the tree depth-wise. | 1772 | * after i_size and walking into the tree depth-wise. |
1775 | */ | 1773 | */ |
1776 | path = kmalloc(sizeof(struct ext4_ext_path) * (depth + 1), GFP_KERNEL); | 1774 | path = kzalloc(sizeof(struct ext4_ext_path) * (depth + 1), GFP_KERNEL); |
1777 | if (path == NULL) { | 1775 | if (path == NULL) { |
1778 | ext4_journal_stop(handle); | 1776 | ext4_journal_stop(handle); |
1779 | return -ENOMEM; | 1777 | return -ENOMEM; |
1780 | } | 1778 | } |
1781 | memset(path, 0, sizeof(struct ext4_ext_path) * (depth + 1)); | ||
1782 | path[0].p_hdr = ext_inode_hdr(inode); | 1779 | path[0].p_hdr = ext_inode_hdr(inode); |
1783 | if (ext4_ext_check_header(__FUNCTION__, inode, path[0].p_hdr)) { | 1780 | if (ext4_ext_check_header(__FUNCTION__, inode, path[0].p_hdr)) { |
1784 | err = -EIO; | 1781 | err = -EIO; |