summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/readahead-replay.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/readahead-replay.c b/src/readahead-replay.c
index a5a2936b3e..32941c144d 100644
--- a/src/readahead-replay.c
+++ b/src/readahead-replay.c
@@ -89,8 +89,8 @@ static int unpack_file(FILE *pack) {
any = true;
if (fd >= 0)
- if (readahead(fd, b * PAGE_SIZE, (c - b) * PAGE_SIZE) < 0) {
- log_warning("readahead() failed: %m");
+ if (posix_fadvise(fd, b * PAGE_SIZE, (c - b) * PAGE_SIZE, POSIX_FADV_WILLNEED) < 0) {
+ log_warning("posix_fadvise() failed: %m");
goto finish;
}
}
@@ -100,8 +100,8 @@ static int unpack_file(FILE *pack) {
* intended to mean that the whole file shall be
* read */
- if (readahead(fd, 0, st.st_size) < 0) {
- log_warning("readahead() failed: %m");
+ if (posix_fadvise(fd, 0, st.st_size, POSIX_FADV_WILLNEED) < 0) {
+ log_warning("posix_fadvise() failed: %m");
goto finish;
}
}