
From: Prasanna Meda <pmeda@akamai.com>

Reorder test_root testing from 3,5,7 to 7,5,3 so that average case becomes
good.  Even number check is added.  

Signed-off-by: Prasanna Meda <pmeda@akamai.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/fs/ext3/balloc.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff -puN fs/ext3/balloc.c~ext3_test_root-speedup fs/ext3/balloc.c
--- 25/fs/ext3/balloc.c~ext3_test_root-speedup	2005-03-07 20:41:35.000000000 -0800
+++ 25-akpm/fs/ext3/balloc.c	2005-03-07 20:41:35.000000000 -0800
@@ -1451,8 +1451,10 @@ static int ext3_group_sparse(int group)
 {
 	if (group <= 1)
 		return 1;
-	return (test_root(group, 3) || test_root(group, 5) ||
-		test_root(group, 7));
+	if (!(group & 1))
+		return 0;
+	return (test_root(group, 7) || test_root(group, 5) ||
+		test_root(group, 3));
 }
 
 /**
_
