Commit ef1ae53d authored by Prasanna Meda's avatar Prasanna Meda Committed by Linus Torvalds

[PATCH] ext3_test_root() speedup

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: default avatarPrasanna Meda <pmeda@akamai.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent bb596f36
...@@ -1451,8 +1451,10 @@ static int ext3_group_sparse(int group) ...@@ -1451,8 +1451,10 @@ static int ext3_group_sparse(int group)
{ {
if (group <= 1) if (group <= 1)
return 1; return 1;
return (test_root(group, 3) || test_root(group, 5) || if (!(group & 1))
test_root(group, 7)); return 0;
return (test_root(group, 7) || test_root(group, 5) ||
test_root(group, 3));
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment