mirror of
https://github.com/systemd/systemd.git
synced 2025-01-21 22:04:01 +03:00
readahead-replay: use posix_fadvise instead of readahead
This commit is contained in:
parent
efe5e8f7e1
commit
6e66797af4
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user