diff options
author | Harald Hoyer <harald@redhat.com> | 2010-09-24 12:54:05 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-09-26 15:53:23 +0200 |
commit | 6e66797af44164c002127c4664064bf60a2fc13b (patch) | |
tree | 96ac809319535643930d6062ce5415ef842e0c68 /src/readahead-replay.c | |
parent | efe5e8f7e114b0ff12c6341617630e1204eca229 (diff) |
readahead-replay: use posix_fadvise instead of readahead
Diffstat (limited to 'src/readahead-replay.c')
-rw-r--r-- | src/readahead-replay.c | 8 |
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; } } |