All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ext4: remove unused macro MB_DEFAULT_MAX_GROUPS_TO_SCAN
@ 2012-04-13  6:30 Robin Dong
  2012-04-13  6:30 ` [PATCH 2/2] ext4: remove unused function argument 'order' in mb_find_extent() Robin Dong
  2012-08-13 14:01 ` [1/2] ext4: remove unused macro MB_DEFAULT_MAX_GROUPS_TO_SCAN Theodore Ts'o
  0 siblings, 2 replies; 4+ messages in thread
From: Robin Dong @ 2012-04-13  6:30 UTC (permalink / raw)
  To: linux-ext4; +Cc: Robin Dong

From: Robin Dong <sanbai@taobao.com>

remove unused macro MB_DEFAULT_MAX_GROUPS_TO_SCAN

Signed-off-by: Robin Dong <sanbai@taobao.com>
---
 fs/ext4/mballoc.h |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/fs/ext4/mballoc.h b/fs/ext4/mballoc.h
index c070618..3ccd889 100644
--- a/fs/ext4/mballoc.h
+++ b/fs/ext4/mballoc.h
@@ -65,11 +65,6 @@ extern u8 mb_enable_debug;
 #define MB_DEFAULT_MIN_TO_SCAN		10
 
 /*
- * How many groups mballoc will scan looking for the best chunk
- */
-#define MB_DEFAULT_MAX_GROUPS_TO_SCAN	5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] ext4: remove unused function argument 'order' in mb_find_extent()
  2012-04-13  6:30 [PATCH 1/2] ext4: remove unused macro MB_DEFAULT_MAX_GROUPS_TO_SCAN Robin Dong
@ 2012-04-13  6:30 ` Robin Dong
  2012-08-13 14:01   ` [2/2] " Theodore Ts'o
  2012-08-13 14:01 ` [1/2] ext4: remove unused macro MB_DEFAULT_MAX_GROUPS_TO_SCAN Theodore Ts'o
  1 sibling, 1 reply; 4+ messages in thread
From: Robin Dong @ 2012-04-13  6:30 UTC (permalink / raw)
  To: linux-ext4; +Cc: Robin Dong

From: Robin Dong <sanbai@taobao.com>

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>
---
 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 99ab428..e81f310 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -1339,17 +1339,17 @@ static void mb_free_blocks(struct inode *inode, struct ext4_buddy *e4b,
 	mb_check_buddy(e4b);
 }
 
-static int mb_find_extent(struct ext4_buddy *e4b, int order, int block,
+static int mb_find_extent(struct ext4_buddy *e4b, int block,
 				int needed, struct ext4_free_extent *ex)
 {
 	int next = block;
-	int max;
+	int max, order;
 	void *buddy;
 
 	assert_spin_locked(ext4_group_lock_ptr(e4b->bd_sb, e4b->bd_group));
 	BUG_ON(ex == NULL);
 
-	buddy = mb_find_buddy(e4b, order, &max);
+	buddy = mb_find_buddy(e4b, 0, &max);
 	BUG_ON(buddy == NULL);
 	BUG_ON(block >= max);
 	if (mb_test_bit(block, buddy)) {
@@ -1359,12 +1359,9 @@ static int mb_find_extent(struct ext4_buddy *e4b, int order, int block,
 		return 0;
 	}
 
-	/* FIXME dorp order completely ? */
-	if (likely(order == 0)) {
-		/* find actual order */
-		order = mb_find_order_for_block(e4b, block);
-		block = block >> order;
-	}
+	/* find actual order */
+	order = mb_find_order_for_block(e4b, block);
+	block = block >> order;
 
 	ex->fe_len = 1 << order;
 	ex->fe_start = block << order;
@@ -1550,7 +1547,7 @@ static void ext4_mb_check_limits(struct ext4_allocation_context *ac,
 		/* recheck chunk's availability - we don't know
 		 * when it was found (within this lock-unlock
 		 * period or not) */
-		max = mb_find_extent(e4b, 0, bex->fe_start, gex->fe_len, &ex);
+		max = mb_find_extent(e4b, bex->fe_start, gex->fe_len, &ex);
 		if (max >= gex->fe_len) {
 			ext4_mb_use_best_found(ac, e4b);
 			return;
@@ -1642,7 +1639,7 @@ int ext4_mb_try_best_found(struct ext4_allocation_context *ac,
 		return err;
 
 	ext4_lock_group(ac->ac_sb, group);
-	max = mb_find_extent(e4b, 0, ex.fe_start, ex.fe_len, &ex);
+	max = mb_find_extent(e4b, ex.fe_start, ex.fe_len, &ex);
 
 	if (max > 0) {
 		ac->ac_b_ex = ex;
@@ -1673,7 +1670,7 @@ int ext4_mb_find_by_goal(struct ext4_allocation_context *ac,
 		return err;
 
 	ext4_lock_group(ac->ac_sb, group);
-	max = mb_find_extent(e4b, 0, ac->ac_g_ex.fe_start,
+	max = mb_find_extent(e4b, ac->ac_g_ex.fe_start,
 			     ac->ac_g_ex.fe_len, &ex);
 
 	if (max >= ac->ac_g_ex.fe_len && ac->ac_g_ex.fe_len == sbi->s_stripe) {
@@ -1789,7 +1786,7 @@ void ext4_mb_complex_scan_group(struct ext4_allocation_context *ac,
 			break;
 		}
 
-		mb_find_extent(e4b, 0, i, ac->ac_g_ex.fe_len, &ex);
+		mb_find_extent(e4b, i, ac->ac_g_ex.fe_len, &ex);
 		BUG_ON(ex.fe_len <= 0);
 		if (free < ex.fe_len) {
 			ext4_grp_locked_error(sb, e4b->bd_group, 0, 0,
@@ -1841,7 +1838,7 @@ void ext4_mb_scan_aligned(struct ext4_allocation_context *ac,
 
 	while (i < EXT4_CLUSTERS_PER_GROUP(sb)) {
 		if (!mb_test_bit(i, bitmap)) {
-			max = mb_find_extent(e4b, 0, i, sbi->s_stripe, &ex);
+			max = mb_find_extent(e4b, i, sbi->s_stripe, &ex);
 			if (max >= sbi->s_stripe) {
 				ac->ac_found++;
 				ac->ac_b_ex = ex;
-- 
1.7.3.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [1/2] ext4: remove unused macro MB_DEFAULT_MAX_GROUPS_TO_SCAN
  2012-04-13  6:30 [PATCH 1/2] ext4: remove unused macro MB_DEFAULT_MAX_GROUPS_TO_SCAN Robin Dong
  2012-04-13  6:30 ` [PATCH 2/2] ext4: remove unused function argument 'order' in mb_find_extent() Robin Dong
@ 2012-08-13 14:01 ` Theodore Ts'o
  1 sibling, 0 replies; 4+ messages in thread
From: Theodore Ts'o @ 2012-08-13 14:01 UTC (permalink / raw)
  To: Robin Dong; +Cc: linux-ext4, Robin Dong

On Thu, Apr 12, 2012 at 08:30:56PM -0000, Robin Dong wrote:
> From: Robin Dong <sanbai@taobao.com>
> 
> remove unused macro MB_DEFAULT_MAX_GROUPS_TO_SCAN
> 
> Signed-off-by: Robin Dong <sanbai@taobao.com>

Applied, thanks.  Apologies for the delay in processing this patch.

	 	  	    	    	  - Ted

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [2/2] ext4: remove unused function argument 'order' in mb_find_extent()
  2012-04-13  6:30 ` [PATCH 2/2] ext4: remove unused function argument 'order' in mb_find_extent() Robin Dong
@ 2012-08-13 14:01   ` Theodore Ts'o
  0 siblings, 0 replies; 4+ messages in thread
From: Theodore Ts'o @ 2012-08-13 14:01 UTC (permalink / raw)
  To: Robin Dong; +Cc: linux-ext4, Robin Dong

On Thu, Apr 12, 2012 at 08:30:57PM -0000, Robin Dong wrote:
> From: Robin Dong <sanbai@taobao.com>
> 
> 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>

Applied, thanks.

					- Ted

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-08-13 14:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-13  6:30 [PATCH 1/2] ext4: remove unused macro MB_DEFAULT_MAX_GROUPS_TO_SCAN Robin Dong
2012-04-13  6:30 ` [PATCH 2/2] ext4: remove unused function argument 'order' in mb_find_extent() Robin Dong
2012-08-13 14:01   ` [2/2] " Theodore Ts'o
2012-08-13 14:01 ` [1/2] ext4: remove unused macro MB_DEFAULT_MAX_GROUPS_TO_SCAN Theodore Ts'o

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.