Whamcloud - gitweb
libext2fs: move a modulo operation out of a hot loop.
authorSami Liedes <sami.liedes@iki.fi>
Thu, 22 Mar 2012 23:42:38 +0000 (19:42 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 22 Mar 2012 23:43:48 +0000 (19:43 -0400)
commit75556776d315e67e411b983cdcdb05eb74b803a9
tree599b66ddbe2c8abcda9904b9a4388339ae531ed6
parent010dc7b90d97b93907cbf57b3b44f1c1cad234f6
libext2fs: move a modulo operation out of a hot loop.

Filesystem shrinking in particular is a heavy user of this loop in
ext2fs_new_inode(). This change makes resize2fs use 24% less CPU time
for shrinking a 100G filesystem.

Signed-off-by: Sami Liedes <sami.liedes@iki.fi>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/alloc.c