Commit 6e66797a authored by Harald Hoyer's avatar Harald Hoyer Committed by Lennart Poettering

readahead-replay: use posix_fadvise instead of readahead

parent efe5e8f7
......@@ -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;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment