[systemd-commits] 2 commits - src/readahead-collect.c src/readahead-replay.c

Lennart Poettering lennart at kemper.freedesktop.org
Sun Sep 26 06:56:09 PDT 2010


 src/readahead-collect.c |    2 +-
 src/readahead-replay.c  |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 6e66797af44164c002127c4664064bf60a2fc13b
Author: Harald Hoyer <harald at redhat.com>
Date:   Fri Sep 24 12:54:05 2010 +0200

    readahead-replay: use posix_fadvise instead of readahead

diff --git a/src/readahead-replay.c b/src/readahead-replay.c
index a5a2936..32941c1 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;
                 }
         }
commit efe5e8f7e114b0ff12c6341617630e1204eca229
Author: Harald Hoyer <harald at redhat.com>
Date:   Fri Sep 24 12:06:02 2010 +0200

    readahead-collect: check for negative return codes of fs_on_ssd()

diff --git a/src/readahead-collect.c b/src/readahead-collect.c
index aa136ce..5c9968a 100644
--- a/src/readahead-collect.c
+++ b/src/readahead-collect.c
@@ -419,7 +419,7 @@ done:
 
         log_debug("Writing Pack File...");
 
-        on_ssd = fs_on_ssd(root);
+        on_ssd = fs_on_ssd(root) == 0;
         log_debug("On SSD: %s", yes_no(on_ssd));
 
         on_btrfs = statfs(root, &sfs) >= 0 && sfs.f_type == BTRFS_SUPER_MAGIC;


More information about the systemd-commits mailing list