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) { ...@@ -89,8 +89,8 @@ static int unpack_file(FILE *pack) {
any = true; any = true;
if (fd >= 0) if (fd >= 0)
if (readahead(fd, b * PAGE_SIZE, (c - b) * PAGE_SIZE) < 0) { if (posix_fadvise(fd, b * PAGE_SIZE, (c - b) * PAGE_SIZE, POSIX_FADV_WILLNEED) < 0) {
log_warning("readahead() failed: %m"); log_warning("posix_fadvise() failed: %m");
goto finish; goto finish;
} }
} }
...@@ -100,8 +100,8 @@ static int unpack_file(FILE *pack) { ...@@ -100,8 +100,8 @@ static int unpack_file(FILE *pack) {
* intended to mean that the whole file shall be * intended to mean that the whole file shall be
* read */ * read */
if (readahead(fd, 0, st.st_size) < 0) { if (posix_fadvise(fd, 0, st.st_size, POSIX_FADV_WILLNEED) < 0) {
log_warning("readahead() failed: %m"); log_warning("posix_fadvise() failed: %m");
goto finish; 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