Skip to content
Commit f4afb4f4 authored by Theodore Ts'o's avatar Theodore Ts'o
Browse files

ext4: optimize test_root()



The test_root() function could potentially loop forever due to
overflow issues.  So rewrite test_root() to avoid this issue; as a
bonus, it is 38% faster when benchmarked via a test loop:

int main(int argc, char **argv)
{
	int  i;

	for (i = 0; i < 1 << 24; i++) {
		if (test_root(i, 7))
			printf("%d\n", i);
	}
}

Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent 2f2e09eb
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