Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42987
b: refs/heads/master
c: 5d4958f
h: refs/heads/master
i:
  42985: bc7c7dd
  42983: 41c5e62
v: v3
  • Loading branch information
Avantika Mathur authored and Linus Torvalds committed Dec 7, 2006
1 parent a8ae144 commit 69dcef7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7e0289766a0750a56260565bd3b74eb544483d45
refs/heads/master: 5d4958f923f431e148d9ba8ff894209a134b943e
9 changes: 3 additions & 6 deletions trunk/fs/ext4/extents.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,13 +477,12 @@ ext4_ext_find_extent(struct inode *inode, int block, struct ext4_ext_path *path)

/* account possible depth increase */
if (!path) {
path = kmalloc(sizeof(struct ext4_ext_path) * (depth + 2),
path = kzalloc(sizeof(struct ext4_ext_path) * (depth + 2),
GFP_NOFS);
if (!path)
return ERR_PTR(-ENOMEM);
alloc = 1;
}
memset(path, 0, sizeof(struct ext4_ext_path) * (depth + 1));
path[0].p_hdr = eh;

/* walk through the tree */
Expand Down Expand Up @@ -643,10 +642,9 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode,
* We need this to handle errors and free blocks
* upon them.
*/
ablocks = kmalloc(sizeof(ext4_fsblk_t) * depth, GFP_NOFS);
ablocks = kzalloc(sizeof(ext4_fsblk_t) * depth, GFP_NOFS);
if (!ablocks)
return -ENOMEM;
memset(ablocks, 0, sizeof(ext4_fsblk_t) * depth);

/* allocate all needed blocks */
ext_debug("allocate %d blocks for indexes/leaf\n", depth - at);
Expand Down Expand Up @@ -1773,12 +1771,11 @@ int ext4_ext_remove_space(struct inode *inode, unsigned long start)
* We start scanning from right side, freeing all the blocks
* after i_size and walking into the tree depth-wise.
*/
path = kmalloc(sizeof(struct ext4_ext_path) * (depth + 1), GFP_KERNEL);
path = kzalloc(sizeof(struct ext4_ext_path) * (depth + 1), GFP_KERNEL);
if (path == NULL) {
ext4_journal_stop(handle);
return -ENOMEM;
}
memset(path, 0, sizeof(struct ext4_ext_path) * (depth + 1));
path[0].p_hdr = ext_inode_hdr(inode);
if (ext4_ext_check_header(__FUNCTION__, inode, path[0].p_hdr)) {
err = -EIO;
Expand Down

0 comments on commit 69dcef7

Please sign in to comment.