From: Mingming Cao This patch addresses the code formatting issues with the ext3 multiple blocks map/allocation patches, to keep it consistent with kernel and ext3 code. Signed-off-by: Mingming Cao Signed-off-by: Andrew Morton --- fs/ext3/inode.c | 24 ++++++++++++------------ ext3/balloc.c | 0 2 files changed, 12 insertions(+), 12 deletions(-) diff -puN fs/ext3/balloc.c~ext3-get-blocks-multiple-block-allocation-cleanup fs/ext3/balloc.c diff -puN fs/ext3/inode.c~ext3-get-blocks-multiple-block-allocation-cleanup fs/ext3/inode.c --- devel/fs/ext3/inode.c~ext3-get-blocks-multiple-block-allocation-cleanup 2006-01-18 20:34:30.000000000 -0800 +++ devel-akpm/fs/ext3/inode.c 2006-01-18 20:34:30.000000000 -0800 @@ -498,12 +498,13 @@ ext3_blks_to_allocate(Indirect * branch, } count++; - while (count < blks && count <= blocks_to_boundary - && le32_to_cpu(*(branch[0].p + count)) == 0) { + while (count < blks && count <= blocks_to_boundary && + le32_to_cpu(*(branch[0].p + count)) == 0) { count++; } return count; } + /** * ext3_alloc_blocks: multiple allocate blocks needed for a branch * @indirect_blks: the number of blocks need to allocate for indirect @@ -518,9 +519,9 @@ static int ext3_alloc_blocks(handle_t *h unsigned long goal, int indirect_blks, int blks, unsigned long long new_blocks[4], int *err) { - int target; - unsigned long count; - int index, i; + int target, i; + unsigned long count = 0; + int index = 0; unsigned long current_block = 0; int ret = 0; @@ -531,10 +532,8 @@ static int ext3_alloc_blocks(handle_t *h * the indirect blocks(if not allocated yet), and at least * the first direct block of this branch. That's the * minimum number of blocks need to allocate(required) - * */ target = blks + indirect_blks; - index = 0; count = 0; while (1) { count = target; @@ -554,8 +553,9 @@ static int ext3_alloc_blocks(handle_t *h break; } - /* save the new block number for the first direct block*/ + /* save the new block number for the first direct block */ new_blocks[index] = current_block; + /* total number of blocks allocated for direct blocks */ ret = count; *err = 0; @@ -605,7 +605,7 @@ static int ext3_alloc_branch(handle_t *h unsigned long long current_block; num = ext3_alloc_blocks(handle, inode, goal, indirect_blks, - *blks, new_blocks, &err); + *blks, new_blocks, &err); if (err) return err; @@ -631,7 +631,7 @@ static int ext3_alloc_branch(handle_t *h } memset(bh->b_data, 0, blocksize); - branch[n].p = (__le32*) bh->b_data + offsets[n]; + branch[n].p = (__le32 *) bh->b_data + offsets[n]; branch[n].key = cpu_to_le32(new_blocks[n]); *branch[n].p = branch[n].key; if ( n == indirect_blks) { @@ -938,8 +938,8 @@ out: static int ext3_direct_io_get_blocks(struct inode *inode, sector_t iblock, - unsigned long max_blocks, struct buffer_head *bh_result, - int create) + unsigned long max_blocks, + struct buffer_head *bh_result, int create) { handle_t *handle = journal_current_handle(); int ret = 0; _