diff options
author | Robin Dong <sanbai@taobao.com> | 2012-08-17 10:02:17 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2012-08-17 10:02:17 -0400 |
commit | 15c006a22f8e004afbce42a54c878162355f1587 (patch) | |
tree | 264e8e58824c183c28b9a6a4134ac82f0a640c56 /fs/ext4/mballoc.c | |
parent | cc6eb18d68fb52a7de65b7a318461ca600240177 (diff) |
ext4: remove unused function argument 'order' in mb_find_extent()
All the routines call mb_find_extent are setting argument 'order' to 0
just like:
mb_find_extent(e4b, 0, ex.fe_start, ex.fe_len, &ex);
therefore the useless argument should be removed.
Signed-off-by: Robin Dong <sanbai@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/mballoc.c')
-rw-r--r-- | fs/ext4/mballoc.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 3a57975b73cc..6873571c9f44 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c | |||
@@ -1338,17 +1338,17 @@ static void mb_free_blocks(struct inode *inode, struct ext4_buddy *e4b, | |||
1338 | mb_check_buddy(e4b); | 1338 | mb_check_buddy(e4b); |
1339 | } | 1339 | } |
1340 | 1340 | ||
1341 | static int mb_find_extent(struct ext4_buddy *e4b, int order, int block, | 1341 | static int mb_find_extent(struct ext4_buddy *e4b, int block, |
1342 | int needed, struct ext4_free_extent *ex) | 1342 | int needed, struct ext4_free_extent *ex) |
1343 | { | 1343 | { |
1344 | int next = block; | 1344 | int next = block; |
1345 | int max; | 1345 | int max, order; |
1346 | void *buddy; | 1346 | void *buddy; |
1347 | 1347 | ||
1348 | assert_spin_locked(ext4_group_lock_ptr(e4b->bd_sb, e4b->bd_group)); | 1348 | assert_spin_locked(ext4_group_lock_ptr(e4b->bd_sb, e4b->bd_group)); |
1349 | BUG_ON(ex == NULL); | 1349 | BUG_ON(ex == NULL); |
1350 | 1350 | ||
1351 | buddy = mb_find_buddy(e4b, order, &max); | 1351 | buddy = mb_find_buddy(e4b, 0, &max); |
1352 | BUG_ON(buddy == NULL); | 1352 | BUG_ON(buddy == NULL); |
1353 | BUG_ON(block >= max); | 1353 | BUG_ON(block >= max); |
1354 | if (mb_test_bit(block, buddy)) { | 1354 | if (mb_test_bit(block, buddy)) { |
@@ -1358,12 +1358,9 @@ static int mb_find_extent(struct ext4_buddy *e4b, int order, int block, | |||
1358 | return 0; | 1358 | return 0; |
1359 | } | 1359 | } |
1360 | 1360 | ||
1361 | /* FIXME dorp order completely ? */ | 1361 | /* find actual order */ |
1362 | if (likely(order == 0)) { | 1362 | order = mb_find_order_for_block(e4b, block); |
1363 | /* find actual order */ | 1363 | block = block >> order; |
1364 | order = mb_find_order_for_block(e4b, block); | ||
1365 | block = block >> order; | ||
1366 | } | ||
1367 | 1364 | ||
1368 | ex->fe_len = 1 << order; | 1365 | ex->fe_len = 1 << order; |
1369 | ex->fe_start = block << order; | 1366 | ex->fe_start = block << order; |
@@ -1549,7 +1546,7 @@ static void ext4_mb_check_limits(struct ext4_allocation_context *ac, | |||
1549 | /* recheck chunk's availability - we don't know | 1546 | /* recheck chunk's availability - we don't know |
1550 | * when it was found (within this lock-unlock | 1547 | * when it was found (within this lock-unlock |
1551 | * period or not) */ | 1548 | * period or not) */ |
1552 | max = mb_find_extent(e4b, 0, bex->fe_start, gex->fe_len, &ex); | 1549 | max = mb_find_extent(e4b, bex->fe_start, gex->fe_len, &ex); |
1553 | if (max >= gex->fe_len) { | 1550 | if (max >= gex->fe_len) { |
1554 | ext4_mb_use_best_found(ac, e4b); | 1551 | ext4_mb_use_best_found(ac, e4b); |
1555 | return; | 1552 | return; |
@@ -1641,7 +1638,7 @@ int ext4_mb_try_best_found(struct ext4_allocation_context *ac, | |||
1641 | return err; | 1638 | return err; |
1642 | 1639 | ||
1643 | ext4_lock_group(ac->ac_sb, group); | 1640 | ext4_lock_group(ac->ac_sb, group); |
1644 | max = mb_find_extent(e4b, 0, ex.fe_start, ex.fe_len, &ex); | 1641 | max = mb_find_extent(e4b, ex.fe_start, ex.fe_len, &ex); |
1645 | 1642 | ||
1646 | if (max > 0) { | 1643 | if (max > 0) { |
1647 | ac->ac_b_ex = ex; | 1644 | ac->ac_b_ex = ex; |
@@ -1672,7 +1669,7 @@ int ext4_mb_find_by_goal(struct ext4_allocation_context *ac, | |||
1672 | return err; | 1669 | return err; |
1673 | 1670 | ||
1674 | ext4_lock_group(ac->ac_sb, group); | 1671 | ext4_lock_group(ac->ac_sb, group); |
1675 | max = mb_find_extent(e4b, 0, ac->ac_g_ex.fe_start, | 1672 | max = mb_find_extent(e4b, ac->ac_g_ex.fe_start, |
1676 | ac->ac_g_ex.fe_len, &ex); | 1673 | ac->ac_g_ex.fe_len, &ex); |
1677 | 1674 | ||
1678 | if (max >= ac->ac_g_ex.fe_len && ac->ac_g_ex.fe_len == sbi->s_stripe) { | 1675 | if (max >= ac->ac_g_ex.fe_len && ac->ac_g_ex.fe_len == sbi->s_stripe) { |
@@ -1788,7 +1785,7 @@ void ext4_mb_complex_scan_group(struct ext4_allocation_context *ac, | |||
1788 | break; | 1785 | break; |
1789 | } | 1786 | } |
1790 | 1787 | ||
1791 | mb_find_extent(e4b, 0, i, ac->ac_g_ex.fe_len, &ex); | 1788 | mb_find_extent(e4b, i, ac->ac_g_ex.fe_len, &ex); |
1792 | BUG_ON(ex.fe_len <= 0); | 1789 | BUG_ON(ex.fe_len <= 0); |
1793 | if (free < ex.fe_len) { | 1790 | if (free < ex.fe_len) { |
1794 | ext4_grp_locked_error(sb, e4b->bd_group, 0, 0, | 1791 | ext4_grp_locked_error(sb, e4b->bd_group, 0, 0, |
@@ -1840,7 +1837,7 @@ void ext4_mb_scan_aligned(struct ext4_allocation_context *ac, | |||
1840 | 1837 | ||
1841 | while (i < EXT4_CLUSTERS_PER_GROUP(sb)) { | 1838 | while (i < EXT4_CLUSTERS_PER_GROUP(sb)) { |
1842 | if (!mb_test_bit(i, bitmap)) { | 1839 | if (!mb_test_bit(i, bitmap)) { |
1843 | max = mb_find_extent(e4b, 0, i, sbi->s_stripe, &ex); | 1840 | max = mb_find_extent(e4b, i, sbi->s_stripe, &ex); |
1844 | if (max >= sbi->s_stripe) { | 1841 | if (max >= sbi->s_stripe) { |
1845 | ac->ac_found++; | 1842 | ac->ac_found++; |
1846 | ac->ac_b_ex = ex; | 1843 | ac->ac_b_ex = ex; |