diff options
| author | Prasanna Meda <pmeda@akamai.com> | 2005-03-07 17:47:43 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-03-07 17:47:43 -0800 |
| commit | ef1ae53d0259c7c9261e848b4553ede8a3e20e35 (patch) | |
| tree | e5ef5025192a6e675b5096f58db7dbf166bcb007 | |
| parent | bb596f367f0112c71dd5b8d278dfdb8044074d53 (diff) | |
[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: Prasanna Meda <pmeda@akamai.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
| -rw-r--r-- | fs/ext3/balloc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c index f069d75e5da7..9a1353671a8b 100644 --- a/fs/ext3/balloc.c +++ b/fs/ext3/balloc.c @@ -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)); } /** |
