aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/ialloc.c
diff options
context:
space:
mode:
authorMingming Cao <cmm@us.ibm.com>2006-10-11 04:21:05 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-11 14:14:16 -0400
commit3a5b2ecdd1fa63a8f25bd769223bc1c2564ce45d (patch)
treedc80fdde9ed01e77ef0ed6fdef7573d303bd07db /fs/ext4/ialloc.c
parenta86c61812637c7dd0c57e29880cffd477b62f2e7 (diff)
[PATCH] ext4: switch fsblk to sector_t
Redefine ext3 in-kernel filesystem block type (ext3_fsblk_t) from unsigned long to sector_t, to allow kernel to handle >32 bit ext3 blocks. Signed-off-by: Mingming Cao <cmm@us.ibm.com> Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/ext4/ialloc.c')
-rw-r--r--fs/ext4/ialloc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index e17a6c918d72..94e1bb4abe31 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -23,7 +23,7 @@
23#include <linux/buffer_head.h> 23#include <linux/buffer_head.h>
24#include <linux/random.h> 24#include <linux/random.h>
25#include <linux/bitops.h> 25#include <linux/bitops.h>
26 26#include <linux/blkdev.h>
27#include <asm/byteorder.h> 27#include <asm/byteorder.h>
28 28
29#include "xattr.h" 29#include "xattr.h"
@@ -274,7 +274,8 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent)
274 freei = percpu_counter_read_positive(&sbi->s_freeinodes_counter); 274 freei = percpu_counter_read_positive(&sbi->s_freeinodes_counter);
275 avefreei = freei / ngroups; 275 avefreei = freei / ngroups;
276 freeb = percpu_counter_read_positive(&sbi->s_freeblocks_counter); 276 freeb = percpu_counter_read_positive(&sbi->s_freeblocks_counter);
277 avefreeb = freeb / ngroups; 277 avefreeb = freeb;
278 sector_div(avefreeb, ngroups);
278 ndirs = percpu_counter_read_positive(&sbi->s_dirs_counter); 279 ndirs = percpu_counter_read_positive(&sbi->s_dirs_counter);
279 280
280 if ((parent == sb->s_root->d_inode) || 281 if ((parent == sb->s_root->d_inode) ||
@@ -303,13 +304,15 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent)
303 goto fallback; 304 goto fallback;
304 } 305 }
305 306
306 blocks_per_dir = (le32_to_cpu(es->s_blocks_count) - freeb) / ndirs; 307 blocks_per_dir = le32_to_cpu(es->s_blocks_count) - freeb;
308 sector_div(blocks_per_dir, ndirs);
307 309
308 max_dirs = ndirs / ngroups + inodes_per_group / 16; 310 max_dirs = ndirs / ngroups + inodes_per_group / 16;
309 min_inodes = avefreei - inodes_per_group / 4; 311 min_inodes = avefreei - inodes_per_group / 4;
310 min_blocks = avefreeb - EXT4_BLOCKS_PER_GROUP(sb) / 4; 312 min_blocks = avefreeb - EXT4_BLOCKS_PER_GROUP(sb) / 4;
311 313
312 max_debt = EXT4_BLOCKS_PER_GROUP(sb) / max(blocks_per_dir, (ext4_fsblk_t)BLOCK_COST); 314 max_debt = EXT4_BLOCKS_PER_GROUP(sb);
315 sector_div(max_debt, max(blocks_per_dir, (ext4_fsblk_t)BLOCK_COST));
313 if (max_debt * INODE_COST > inodes_per_group) 316 if (max_debt * INODE_COST > inodes_per_group)
314 max_debt = inodes_per_group / INODE_COST; 317 max_debt = inodes_per_group / INODE_COST;
315 if (max_debt > 255) 318 if (max_debt > 255)