From 8705cb99a3b10dbdfd5490f04ed7c361971c26b2 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Mon, 18 Nov 2019 19:54:14 +0530 Subject: [PATCH] Seek advantage of kernel readahead() References: 1. http://man7.org/linux/man-pages/man2/posix_fadvise.2.html 2. https://www.oreilly.com/library/view/linux-system-programming/9781449341527/ch04.html --- src/nnn.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nnn.c b/src/nnn.c index a2679947..4a7f7e36 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -3512,6 +3512,8 @@ static int dentfill(char *path, struct entry **dents) open_max = max_openfds(); } + posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL); + dp = readdir(dirp); if (!dp) goto exit;