ext4: fix suboptimal seek_{data,hole} extents traversial
authorDmitry Monakhov <dmonakhov@openvz.org>
Tue, 2 Dec 2014 23:08:53 +0000 (18:08 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 2 Dec 2014 23:08:53 +0000 (18:08 -0500)
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 <dmonakhov@openvz.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/extents.c
fs/ext4/file.c

Simple merge
diff --cc fs/ext4/file.c
Simple merge