]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commit - e2fsck/region.c
e2fsck: add optimization for large, fragmented sparse files
authorTheodore Ts'o <tytso@mit.edu>
Mon, 14 Aug 2017 23:52:39 +0000 (19:52 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 14 Aug 2017 23:52:39 +0000 (19:52 -0400)
commit8a48ce07a5923242fecc5dc04d6e30dd59a8f07d
treea9a05e34cfe63be52f075c9519eecb65c0f6da40
parentf25b334c5093a1a5e2985c7ed58213a52ba06329
e2fsck: add optimization for large, fragmented sparse files

The code which checks for overlapping logical blocks in an extent tree
is O(h*e) in time, where h is the number of holes in the file, and e
is the number of extents in the file.  So a file with a large number
of holes can take e2fsck a long time process.  Optimize this taking
advantage of the fact the vast majority of the time, region_allocate()
is called with increasing logical block numbers, so we are almost
always append onto the end of the region list.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/region.c