diff options
author | Theodore Ts'o <tytso@mit.edu> | 2008-11-05 00:14:04 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2008-11-05 00:14:04 -0500 |
commit | 498e5f24158da7bf8fa48074a70e370e22844492 (patch) | |
tree | 1434b349c8eca3b0667af0b385533cbcd599c1c3 /fs/ext4/extents.c | |
parent | a9df9a49102f3578909cba7bd33784eb3b9caaa4 (diff) |
ext4: Change unsigned long to unsigned int
Convert the unsigned longs that are most responsible for bloating the
stack usage on 64-bit systems.
Nearly all places in the ext3/4 code which uses "unsigned long" is
probably a bug, since on 32-bit systems a ulong a 32-bits, which means
we are wasting stack space on 64-bit systems.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/extents.c')
-rw-r--r-- | fs/ext4/extents.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index b9e27bc31559..b92cb60737bd 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c | |||
@@ -2377,7 +2377,7 @@ static int ext4_ext_convert_to_initialized(handle_t *handle, | |||
2377 | struct inode *inode, | 2377 | struct inode *inode, |
2378 | struct ext4_ext_path *path, | 2378 | struct ext4_ext_path *path, |
2379 | ext4_lblk_t iblock, | 2379 | ext4_lblk_t iblock, |
2380 | unsigned long max_blocks) | 2380 | unsigned int max_blocks) |
2381 | { | 2381 | { |
2382 | struct ext4_extent *ex, newex, orig_ex; | 2382 | struct ext4_extent *ex, newex, orig_ex; |
2383 | struct ext4_extent *ex1 = NULL; | 2383 | struct ext4_extent *ex1 = NULL; |
@@ -2675,26 +2675,26 @@ fix_extent_len: | |||
2675 | */ | 2675 | */ |
2676 | int ext4_ext_get_blocks(handle_t *handle, struct inode *inode, | 2676 | int ext4_ext_get_blocks(handle_t *handle, struct inode *inode, |
2677 | ext4_lblk_t iblock, | 2677 | ext4_lblk_t iblock, |
2678 | unsigned long max_blocks, struct buffer_head *bh_result, | 2678 | unsigned int max_blocks, struct buffer_head *bh_result, |
2679 | int create, int extend_disksize) | 2679 | int create, int extend_disksize) |
2680 | { | 2680 | { |
2681 | struct ext4_ext_path *path = NULL; | 2681 | struct ext4_ext_path *path = NULL; |
2682 | struct ext4_extent_header *eh; | 2682 | struct ext4_extent_header *eh; |
2683 | struct ext4_extent newex, *ex; | 2683 | struct ext4_extent newex, *ex; |
2684 | ext4_fsblk_t goal, newblock; | 2684 | ext4_fsblk_t newblock; |
2685 | int err = 0, depth, ret; | 2685 | int err = 0, depth, ret, cache_type; |
2686 | unsigned long allocated = 0; | 2686 | unsigned int allocated = 0; |
2687 | struct ext4_allocation_request ar; | 2687 | struct ext4_allocation_request ar; |
2688 | loff_t disksize; | 2688 | loff_t disksize; |
2689 | 2689 | ||
2690 | __clear_bit(BH_New, &bh_result->b_state); | 2690 | __clear_bit(BH_New, &bh_result->b_state); |
2691 | ext_debug("blocks %u/%lu requested for inode %u\n", | 2691 | ext_debug("blocks %u/%u requested for inode %u\n", |
2692 | iblock, max_blocks, inode->i_ino); | 2692 | iblock, max_blocks, inode->i_ino); |
2693 | 2693 | ||
2694 | /* check in cache */ | 2694 | /* check in cache */ |
2695 | goal = ext4_ext_in_cache(inode, iblock, &newex); | 2695 | cache_type = ext4_ext_in_cache(inode, iblock, &newex); |
2696 | if (goal) { | 2696 | if (cache_type) { |
2697 | if (goal == EXT4_EXT_CACHE_GAP) { | 2697 | if (cache_type == EXT4_EXT_CACHE_GAP) { |
2698 | if (!create) { | 2698 | if (!create) { |
2699 | /* | 2699 | /* |
2700 | * block isn't allocated yet and | 2700 | * block isn't allocated yet and |
@@ -2703,7 +2703,7 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode, | |||
2703 | goto out2; | 2703 | goto out2; |
2704 | } | 2704 | } |
2705 | /* we should allocate requested block */ | 2705 | /* we should allocate requested block */ |
2706 | } else if (goal == EXT4_EXT_CACHE_EXTENT) { | 2706 | } else if (cache_type == EXT4_EXT_CACHE_EXTENT) { |
2707 | /* block is already allocated */ | 2707 | /* block is already allocated */ |
2708 | newblock = iblock | 2708 | newblock = iblock |
2709 | - le32_to_cpu(newex.ee_block) | 2709 | - le32_to_cpu(newex.ee_block) |
@@ -2851,7 +2851,7 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode, | |||
2851 | if (!newblock) | 2851 | if (!newblock) |
2852 | goto out2; | 2852 | goto out2; |
2853 | ext_debug("allocate new block: goal %llu, found %llu/%lu\n", | 2853 | ext_debug("allocate new block: goal %llu, found %llu/%lu\n", |
2854 | goal, newblock, allocated); | 2854 | ar.goal, newblock, allocated); |
2855 | 2855 | ||
2856 | /* try to insert new extent into found leaf and return */ | 2856 | /* try to insert new extent into found leaf and return */ |
2857 | ext4_ext_store_pblock(&newex, newblock); | 2857 | ext4_ext_store_pblock(&newex, newblock); |
@@ -3001,7 +3001,7 @@ long ext4_fallocate(struct inode *inode, int mode, loff_t offset, loff_t len) | |||
3001 | handle_t *handle; | 3001 | handle_t *handle; |
3002 | ext4_lblk_t block; | 3002 | ext4_lblk_t block; |
3003 | loff_t new_size; | 3003 | loff_t new_size; |
3004 | unsigned long max_blocks; | 3004 | unsigned int max_blocks; |
3005 | int ret = 0; | 3005 | int ret = 0; |
3006 | int ret2 = 0; | 3006 | int ret2 = 0; |
3007 | int retries = 0; | 3007 | int retries = 0; |