[RFC 4/13] extents and 48bit ext3: convert ext3 filesystem blocks to ext3_fsblk_t

[RFC 4/13] extents and 48bit ext3: convert ext3 filesystem blocks to ext3_fsblk_t

Post by Mingming C » Sat, 10 Jun 2006 10:30:08


Convert the rest of all unsigned long type in-kernel filesystem
blocks to ext3_fsblk_t, and replace the printk format string
respondingly.

Signed-Off-By: Mingming Cao < XXXX@XXXXX.COM >


---

linux-2.6.16-ming/fs/ext3/balloc.c | 29 ++++++--------
linux-2.6.16-ming/fs/ext3/inode.c | 55 ++++++++++++++--------------
linux-2.6.16-ming/fs/ext3/ioctl.c | 2 -
linux-2.6.16-ming/fs/ext3/resize.c | 34 +++++++++--------
linux-2.6.16-ming/fs/ext3/super.c | 33 ++++++++--------
linux-2.6.16-ming/fs/ext3/xattr.c | 12 +++---
linux-2.6.16-ming/include/linux/ext3_fs.h | 12 +++++-
linux-2.6.16-ming/include/linux/ext3_fs_i.h | 8 ++--
8 files changed, 97 insertions(+), 88 deletions(-)

diff -puN fs/ext3/balloc.c~ext3_convert_blks_to_fsblk_t fs/ext3/balloc.c
--- linux-2.6.16/fs/ext3/balloc.c~ext3_convert_blks_to_fsblk_t 2006-06-07 15:43:17.000000000 -0700
+++ linux-2.6.16-ming/fs/ext3/balloc.c 2006-06-08 16:49:57.494951296 -0700
@@ -168,8 +168,7 @@ goal_in_my_reservation(struct ext3_reser
{
ext3_fsblk_t group_first_block, group_last_block;

- group_first_block = le32_to_cpu(EXT3_SB(sb)->s_es->s_first_data_block) +
- group * EXT3_BLOCKS_PER_GROUP(sb);
+ group_first_block = ext3_group_first_block_no(sb, group);
group_last_block = group_first_block + EXT3_BLOCKS_PER_GROUP(sb) - 1;

if ((rsv->_rsv_start > group_last_block) ||
@@ -664,9 +663,7 @@ ext3_try_to_allocate(struct super_block

/* we do allocation within the reservation window if we have a window */
if (my_rsv) {
- group_first_block =
- le32_to_cpu(EXT3_SB(sb)->s_es->s_first_data_block) +
- group * EXT3_BLOCKS_PER_GROUP(sb);
+ group_first_block = ext3_group_first_block_no(sb, group);
if (my_rsv->_rsv_start >= group_first_block)
start = my_rsv->_rsv_start - group_first_block;
else
@@ -900,8 +897,7 @@ static int alloc_new_reservation(struct
int ret;
spinlock_t *rsv_lock = &EXT3_SB(sb)->s_rsv_window_lock;

- group_first_block = le32_to_cpu(EXT3_SB(sb)->s_es->s_first_data_block) +
- group * EXT3_BLOCKS_PER_GROUP(sb);
+ group_first_block = ext3_group_first_block_no(sb, group);
group_end_block = group_first_block + EXT3_BLOCKS_PER_GROUP(sb) - 1;

if (grp_goal < 0)
@@ -1104,8 +1100,7 @@ ext3_try_to_allocate_with_rsv(struct sup
* first block is a filesystem wide block number
* first block is the block number of the first block in this group
*/
- group_first_block = le32_to_cpu(EXT3_SB(sb)->s_es->s_first_data_block) +
- group * EXT3_BLOCKS_PER_GROUP(sb);
+ group_first_block = ext3_group_first_block_no(sb, group);

/*
* Basically we will allocate a new block from inode's reservation
@@ -1371,8 +1366,7 @@ allocated:
if (fatal)
goto out;

- ret_block = grp_alloc_blk + group_no * EXT3_BLOCKS_PER_GROUP(sb)
- + le32_to_cpu(es->s_first_data_block);
+ ret_block = grp_alloc_blk + ext3_group_first_block_no(sb, group_no);

if (in_range(le32_to_cpu(gdp->bg_block_bitmap), ret_block, num) ||
in_range(le32_to_cpu(gdp->bg_inode_bitmap), ret_block, num) ||
@@ -1478,15 +1472,16 @@ ext3_fsblk_t ext3_new_block(handle_t *ha
return ext3_new_blocks(handle, inode, goal, &count, errp);
}

-unsigned long ext3_count_free_blocks(struct super_block *sb)
+ext3_fsblk_t ext3_count_free_blocks(struct super_block *sb)
{
- unsigned lon