aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/inode.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2008-11-05 00:14:04 -0500
committerTheodore Ts'o <tytso@mit.edu>2008-11-05 00:14:04 -0500
commit498e5f24158da7bf8fa48074a70e370e22844492 (patch)
tree1434b349c8eca3b0667af0b385533cbcd599c1c3 /fs/ext4/inode.c
parenta9df9a49102f3578909cba7bd33784eb3b9caaa4 (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/inode.c')
-rw-r--r--fs/ext4/inode.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 45d0f70a1f04..91e06f88f08c 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -514,10 +514,10 @@ static ext4_fsblk_t ext4_find_goal(struct inode *inode, ext4_lblk_t block,
514 * return the total number of blocks to be allocate, including the 514 * return the total number of blocks to be allocate, including the
515 * direct and indirect blocks. 515 * direct and indirect blocks.
516 */ 516 */
517static int ext4_blks_to_allocate(Indirect *branch, int k, unsigned long blks, 517static int ext4_blks_to_allocate(Indirect *branch, int k, unsigned int blks,
518 int blocks_to_boundary) 518 int blocks_to_boundary)
519{ 519{
520 unsigned long count = 0; 520 unsigned int count = 0;
521 521
522 /* 522 /*
523 * Simple case, [t,d]Indirect block(s) has not allocated yet 523 * Simple case, [t,d]Indirect block(s) has not allocated yet
@@ -856,10 +856,10 @@ err_out:
856 * down_read(&EXT4_I(inode)->i_data_sem) if not allocating file system block 856 * down_read(&EXT4_I(inode)->i_data_sem) if not allocating file system block
857 * (ie, create is zero). Otherwise down_write(&EXT4_I(inode)->i_data_sem) 857 * (ie, create is zero). Otherwise down_write(&EXT4_I(inode)->i_data_sem)
858 */ 858 */
859int ext4_get_blocks_handle(handle_t *handle, struct inode *inode, 859static int ext4_get_blocks_handle(handle_t *handle, struct inode *inode,
860 ext4_lblk_t iblock, unsigned long maxblocks, 860 ext4_lblk_t iblock, unsigned int maxblocks,
861 struct buffer_head *bh_result, 861 struct buffer_head *bh_result,
862 int create, int extend_disksize) 862 int create, int extend_disksize)
863{ 863{
864 int err = -EIO; 864 int err = -EIO;
865 ext4_lblk_t offsets[4]; 865 ext4_lblk_t offsets[4];
@@ -1061,7 +1061,7 @@ static void ext4_da_update_reserve_space(struct inode *inode, int used)
1061 * It returns the error in case of allocation failure. 1061 * It returns the error in case of allocation failure.
1062 */ 1062 */
1063int ext4_get_blocks_wrap(handle_t *handle, struct inode *inode, sector_t block, 1063int ext4_get_blocks_wrap(handle_t *handle, struct inode *inode, sector_t block,
1064 unsigned long max_blocks, struct buffer_head *bh, 1064 unsigned int max_blocks, struct buffer_head *bh,
1065 int create, int extend_disksize, int flag) 1065 int create, int extend_disksize, int flag)
1066{ 1066{
1067 int retval; 1067 int retval;
@@ -1641,7 +1641,7 @@ struct mpage_da_data {
1641 get_block_t *get_block; 1641 get_block_t *get_block;
1642 struct writeback_control *wbc; 1642 struct writeback_control *wbc;
1643 int io_done; 1643 int io_done;
1644 long pages_written; 1644 int pages_written;
1645 int retval; 1645 int retval;
1646}; 1646};
1647 1647
@@ -1855,9 +1855,9 @@ static void ext4_print_free_blocks(struct inode *inode)
1855 printk(KERN_EMERG "dirty_blocks=%lld\n", 1855 printk(KERN_EMERG "dirty_blocks=%lld\n",
1856 (long long)percpu_counter_sum(&sbi->s_dirtyblocks_counter)); 1856 (long long)percpu_counter_sum(&sbi->s_dirtyblocks_counter));
1857 printk(KERN_EMERG "Block reservation details\n"); 1857 printk(KERN_EMERG "Block reservation details\n");
1858 printk(KERN_EMERG "i_reserved_data_blocks=%lu\n", 1858 printk(KERN_EMERG "i_reserved_data_blocks=%u\n",
1859 EXT4_I(inode)->i_reserved_data_blocks); 1859 EXT4_I(inode)->i_reserved_data_blocks);
1860 printk(KERN_EMERG "i_reserved_meta_blocks=%lu\n", 1860 printk(KERN_EMERG "i_reserved_meta_blocks=%u\n",
1861 EXT4_I(inode)->i_reserved_meta_blocks); 1861 EXT4_I(inode)->i_reserved_meta_blocks);
1862 return; 1862 return;
1863} 1863}
@@ -2307,7 +2307,7 @@ static int ext4_da_writepage(struct page *page,
2307{ 2307{
2308 int ret = 0; 2308 int ret = 0;
2309 loff_t size; 2309 loff_t size;
2310 unsigned long len; 2310 unsigned int len;
2311 struct buffer_head *page_bufs; 2311 struct buffer_head *page_bufs;
2312 struct inode *inode = page->mapping->host; 2312 struct inode *inode = page->mapping->host;
2313 2313
@@ -2416,7 +2416,8 @@ static int ext4_da_writepages(struct address_space *mapping,
2416 struct mpage_da_data mpd; 2416 struct mpage_da_data mpd;
2417 struct inode *inode = mapping->host; 2417 struct inode *inode = mapping->host;
2418 int no_nrwrite_index_update; 2418 int no_nrwrite_index_update;
2419 long pages_written = 0, pages_skipped; 2419 int pages_written = 0;
2420 long pages_skipped;
2420 int needed_blocks, ret = 0, nr_to_writebump = 0; 2421 int needed_blocks, ret = 0, nr_to_writebump = 0;
2421 struct ext4_sb_info *sbi = EXT4_SB(mapping->host->i_sb); 2422 struct ext4_sb_info *sbi = EXT4_SB(mapping->host->i_sb);
2422 2423