From: Dmitry Monakhov Date: Tue, 2 Dec 2014 23:08:53 +0000 (-0500) Subject: ext4: fix suboptimal seek_{data,hole} extents traversial X-Git-Tag: omap-for-v3.19/fixes-rc1~116^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14516bb7bb6ffbd49f35389f9ece3b2045ba5815;p=pandora-kernel.git ext4: fix suboptimal seek_{data,hole} extents traversial It is ridiculous practice to scan inode block by block, this technique applicable only for old indirect files. This takes significant amount of time for really large files. Let's reuse ext4_fiemap which already traverse inode-tree in most optimal meaner. TESTCASE: ftruncate64(fd, 0); ftruncate64(fd, 1ULL << 40); /* lseek will spin very long time */ lseek64(fd, 0, SEEK_DATA); lseek64(fd, 0, SEEK_HOLE); Original report: https://lkml.org/lkml/2014/10/16/620 Signed-off-by: Dmitry Monakhov Signed-off-by: Theodore Ts'o --- Reading git-diff-tree failed