Read-ahead doesn't work very well on device probing, and can hurt a lot
when we do essentially random accesses on very slow devices. So disable it
if possible.
[kzak@redhat.com: - add posix_fadvise() configure test]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
setresuid \
inotify_init \
prctl \
+ posix_fadvise \
getmntinfo \
__secure_getenv \
rpmatch])
pr->mode = 0;
pr->blkssz = 0;
+#if defined(POSIX_FADV_RANDOM) && defined(HAVE_POSIX_FADVISE)
+ /* Disable read-ahead */
+ posix_fadvise(fd, 0, 0, POSIX_FADV_RANDOM);
+#endif
if (size)
pr->size = size;
else {