pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
preload: Use readahead on Linux
Module Name: pkgsrc-wip
Committed By: Mateusz Poszwa <old4%o2.pl@localhost>
Pushed By: f8l
Date: Fri Mar 3 23:48:48 2017 +0100
Changeset: 1d8910658e0f437797d975760e5ba8327f47fbd3
Modified Files:
preload/TODO
preload/distinfo
preload/patches/patch-src_readahead.c
Log Message:
preload: Use readahead on Linux
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=1d8910658e0f437797d975760e5ba8327f47fbd3
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
preload/TODO | 1 +
preload/distinfo | 2 +-
preload/patches/patch-src_readahead.c | 7 +++++--
3 files changed, 7 insertions(+), 3 deletions(-)
diffs:
diff --git a/preload/TODO b/preload/TODO
index 73075fc272..9b5bcff93e 100644
--- a/preload/TODO
+++ b/preload/TODO
@@ -1,3 +1,4 @@
* Tweak autoconf and readahead.c to use readahead if it’s available.
* Allow custom VARBASE.
* Try to make makefiles compatible with BSD make.
+* /usr/pkg/var/lib/preload/preload.state and /usr/pkg/var/log/preload.log fail MD5 checksum on pkg_admin check.
diff --git a/preload/distinfo b/preload/distinfo
index ff85dc329b..4234d724fb 100644
--- a/preload/distinfo
+++ b/preload/distinfo
@@ -8,4 +8,4 @@ SHA1 (patch-configure) = 16560fbfa008e2d118f09a2296059b6a0e69a7dd
SHA1 (patch-preload.init.in) = 2f73b46366a9133ee244eeedd3f6b012a62333b5
SHA1 (patch-src_Makefile.in) = f7614afeaedb9672120025e3d10fdefcadf0f6c4
SHA1 (patch-src_gen.preload.conf.sh) = 1f34459dd35f09e01498af4d6ca03e072416307e
-SHA1 (patch-src_readahead.c) = e381c44ceec51f40cb5cd21a58f38c44ccaf27d1
+SHA1 (patch-src_readahead.c) = 83f6b071c2cb53090354c112657ffe6a54a58ef3
diff --git a/preload/patches/patch-src_readahead.c b/preload/patches/patch-src_readahead.c
index 548f7ccd64..1fa92bfb09 100644
--- a/preload/patches/patch-src_readahead.c
+++ b/preload/patches/patch-src_readahead.c
@@ -4,11 +4,13 @@ Use posix_fadvise and pread instead of readahead for greater portability.
--- src/readahead.c.orig 2008-10-23 01:08:21.000000000 +0000
+++ src/readahead.c
-@@ -152,7 +152,15 @@ process_file(const char *path, size_t of
+@@ -152,7 +152,19 @@ process_file(const char *path, size_t of
);
if (fd >= 0)
{
-- readahead(fd, offset, length);
++#ifdef __linux__
+ readahead(fd, offset, length);
++#else
+ char buf[4096];
+ size_t end = offset + length;
+
@@ -18,6 +20,7 @@ Use posix_fadvise and pread instead of readahead for greater portability.
+ size_t unread = end - i, nbytes = unread < 4096 ? unread : 4096;
+ pread(fd, buf, nbytes, i);
+ }
++#endif
close (fd);
}
Home |
Main Index |
Thread Index |
Old Index