diff options
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/balloc.c | 2 | ||||
-rw-r--r-- | fs/ext4/ialloc.c | 6 | ||||
-rw-r--r-- | fs/ext4/super.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c index 402475a6f3df..5d45582f9517 100644 --- a/fs/ext4/balloc.c +++ b/fs/ext4/balloc.c | |||
@@ -34,7 +34,7 @@ void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr, | |||
34 | ext4_grpblk_t offset; | 34 | ext4_grpblk_t offset; |
35 | 35 | ||
36 | blocknr = blocknr - le32_to_cpu(es->s_first_data_block); | 36 | blocknr = blocknr - le32_to_cpu(es->s_first_data_block); |
37 | offset = sector_div(blocknr, EXT4_BLOCKS_PER_GROUP(sb)); | 37 | offset = do_div(blocknr, EXT4_BLOCKS_PER_GROUP(sb)); |
38 | if (offsetp) | 38 | if (offsetp) |
39 | *offsetp = offset; | 39 | *offsetp = offset; |
40 | if (blockgrpp) | 40 | if (blockgrpp) |
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index 75608e1e5555..c88b439ba5cd 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c | |||
@@ -275,7 +275,7 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent) | |||
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; | 277 | avefreeb = freeb; |
278 | sector_div(avefreeb, ngroups); | 278 | do_div(avefreeb, ngroups); |
279 | ndirs = percpu_counter_read_positive(&sbi->s_dirs_counter); | 279 | ndirs = percpu_counter_read_positive(&sbi->s_dirs_counter); |
280 | 280 | ||
281 | if ((parent == sb->s_root->d_inode) || | 281 | if ((parent == sb->s_root->d_inode) || |
@@ -305,14 +305,14 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent) | |||
305 | } | 305 | } |
306 | 306 | ||
307 | blocks_per_dir = ext4_blocks_count(es) - freeb; | 307 | blocks_per_dir = ext4_blocks_count(es) - freeb; |
308 | sector_div(blocks_per_dir, ndirs); | 308 | do_div(blocks_per_dir, ndirs); |
309 | 309 | ||
310 | max_dirs = ndirs / ngroups + inodes_per_group / 16; | 310 | max_dirs = ndirs / ngroups + inodes_per_group / 16; |
311 | min_inodes = avefreei - inodes_per_group / 4; | 311 | min_inodes = avefreei - inodes_per_group / 4; |
312 | min_blocks = avefreeb - EXT4_BLOCKS_PER_GROUP(sb) / 4; | 312 | min_blocks = avefreeb - EXT4_BLOCKS_PER_GROUP(sb) / 4; |
313 | 313 | ||
314 | max_debt = EXT4_BLOCKS_PER_GROUP(sb); | 314 | max_debt = EXT4_BLOCKS_PER_GROUP(sb); |
315 | sector_div(max_debt, max(blocks_per_dir, (ext4_fsblk_t)BLOCK_COST)); | 315 | max_debt /= max_t(int, blocks_per_dir, BLOCK_COST); |
316 | if (max_debt * INODE_COST > inodes_per_group) | 316 | if (max_debt * INODE_COST > inodes_per_group) |
317 | max_debt = inodes_per_group / INODE_COST; | 317 | max_debt = inodes_per_group / INODE_COST; |
318 | if (max_debt > 255) | 318 | if (max_debt > 255) |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 811011fc5c94..f7ea0224f535 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -1485,7 +1485,7 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent) | |||
1485 | */ | 1485 | */ |
1486 | if (blocksize != EXT4_MIN_BLOCK_SIZE) { | 1486 | if (blocksize != EXT4_MIN_BLOCK_SIZE) { |
1487 | logic_sb_block = sb_block * EXT4_MIN_BLOCK_SIZE; | 1487 | logic_sb_block = sb_block * EXT4_MIN_BLOCK_SIZE; |
1488 | offset = sector_div(logic_sb_block, blocksize); | 1488 | offset = do_div(logic_sb_block, blocksize); |
1489 | } else { | 1489 | } else { |
1490 | logic_sb_block = sb_block; | 1490 | logic_sb_block = sb_block; |
1491 | } | 1491 | } |
@@ -1591,7 +1591,7 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent) | |||
1591 | brelse (bh); | 1591 | brelse (bh); |
1592 | sb_set_blocksize(sb, blocksize); | 1592 | sb_set_blocksize(sb, blocksize); |
1593 | logic_sb_block = sb_block * EXT4_MIN_BLOCK_SIZE; | 1593 | logic_sb_block = sb_block * EXT4_MIN_BLOCK_SIZE; |
1594 | offset = sector_div(logic_sb_block, blocksize); | 1594 | offset = do_div(logic_sb_block, blocksize); |
1595 | bh = sb_bread(sb, logic_sb_block); | 1595 | bh = sb_bread(sb, logic_sb_block); |
1596 | if (!bh) { | 1596 | if (!bh) { |
1597 | printk(KERN_ERR | 1597 | printk(KERN_ERR |