ext4: remove do_blk_alloc()

The convenience function do_blk_alloc() is a static function with only
one caller, so fold it into ext4_new_meta_blocks() to simplify the
code and to make it easier to understand.

To save more stack space, if count is a null pointer in
ext4_new_meta_blocks() assume that caller wanted a single block (and
if there is an error, no blocks were allocated).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This commit is contained in:
Theodore Ts'o
2008-12-12 12:41:28 -05:00
parent cfe82c8567
commit 97df5d155d
3 changed files with 17 additions and 38 deletions

View File

@@ -189,10 +189,9 @@ ext4_ext_new_meta_block(handle_t *handle, struct inode *inode,
struct ext4_extent *ex, int *err)
{
ext4_fsblk_t goal, newblock;
unsigned long count = 1;
goal = ext4_ext_find_goal(inode, path, le32_to_cpu(ex->ee_block));
newblock = ext4_new_meta_blocks(handle, inode, goal, &count, err);
newblock = ext4_new_meta_blocks(handle, inode, goal, NULL, err);
return newblock;
}