Permalink
Browse files

Revive systemd-readahead

This reverts the following upstream commits:
cb607ec "remove references of readahead"
c7e4a7b "missing: remove fanotify"
d6bc834 "readahead: wipe out readahead"
  • Loading branch information...
jprvita committed Mar 9, 2016
1 parent 6ffdce2 commit bbdd3e20079eaaed567238cfc3201f081f7714c1
Showing with 2,801 additions and 24 deletions.
  1. +1 −0 .gitignore
  2. +31 −0 Makefile-man.am
  3. +54 −1 Makefile.am
  4. +1 −0 README
  5. +7 −0 TODO
  6. +10 −0 configure.ac
  7. +1 −0 man/sd-daemon.xml
  8. +1 −0 man/sd-login.xml
  9. +117 −0 man/sd-readahead.xml
  10. +178 −0 man/sd_readahead.xml
  11. +11 −0 man/systemd-notify.xml
  12. +203 −0 man/systemd-readahead-replay.service.xml
  13. +1 −0 po/POTFILES.skip
  14. +2 −1 shell-completion/zsh/_systemd
  15. +1 −1 src/cryptsetup/cryptsetup-generator.c
  16. +1 −0 src/gpt-auto-generator/gpt-auto-generator.c
  17. +20 −2 src/notify/notify.c
  18. +1 −0 src/readahead/Makefile
  19. +148 −0 src/readahead/readahead-analyze.c
  20. +656 −0 src/readahead/readahead-collect.c
  21. +402 −0 src/readahead/readahead-common.c
  22. +61 −0 src/readahead/readahead-common.h
  23. +284 −0 src/readahead/readahead-replay.c
  24. +165 −0 src/readahead/readahead.c
  25. +89 −0 src/readahead/sd-readahead.c
  26. +41 −0 src/readahead/test-ssd.c
  27. +98 −0 src/shared/linux/fanotify.h
  28. +73 −0 src/systemd/sd-readahead.h
  29. +1 −0 system-preset/90-systemd.preset
  30. +3 −0 units/.gitignore
  31. +1 −1 units/ldconfig.service
  32. +1 −1 units/quotaon.service.in
  33. +1 −1 units/system-update.target
  34. +1 −1 units/systemd-backlight@.service.in
  35. +1 −1 units/systemd-binfmt.service.in
  36. +1 −1 units/systemd-firstboot.service.in
  37. +1 −1 units/systemd-fsck-root.service.in
  38. +1 −1 units/systemd-fsck@.service.in
  39. +1 −1 units/systemd-hwdb-update.service.in
  40. +1 −1 units/systemd-journal-catalog-update.service.in
  41. +1 −0 units/systemd-modules-load.service.in
  42. +1 −1 units/systemd-quotacheck.service.in
  43. +1 −1 units/systemd-random-seed.service.in
  44. +28 −0 units/systemd-readahead-collect.service.in
  45. +22 −0 units/systemd-readahead-done.service.in
  46. +22 −0 units/systemd-readahead-done.timer
  47. +19 −0 units/systemd-readahead-drop.service
  48. +26 −0 units/systemd-readahead-replay.service.in
  49. +1 −1 units/systemd-remount-fs.service.in
  50. +1 −0 units/systemd-sysctl.service.in
  51. +1 −1 units/systemd-sysusers.service.in
  52. +1 −1 units/systemd-tmpfiles-clean.service.in
  53. +1 −1 units/systemd-tmpfiles-setup-dev.service.in
  54. +1 −1 units/systemd-tmpfiles-setup.service.in
  55. +1 −1 units/systemd-update-done.service.in
  56. +1 −1 units/systemd-update-utmp.service.in
  57. +1 −0 units/systemd-vconsole-setup.service.in
View
@@ -101,6 +101,7 @@
/systemd-quotacheck
/systemd-random-seed
/systemd-rc-local-generator
/systemd-readahead
/systemd-remount-fs
/systemd-reply-password
/systemd-resolve
View
@@ -2155,6 +2155,34 @@ man/systemd-random-seed.html: man/systemd-random-seed.service.html
endif
if ENABLE_READAHEAD
MANPAGES += \
man/sd-readahead.3 \
man/sd_readahead.3 \
man/systemd-readahead-replay.service.8
MANPAGES_ALIAS += \
man/systemd-readahead-collect.service.8 \
man/systemd-readahead-done.service.8 \
man/systemd-readahead-done.timer.8 \
man/systemd-readahead.8
man/systemd-readahead-collect.service.8: man/systemd-readahead-replay.service.8
man/systemd-readahead-done.service.8: man/systemd-readahead-replay.service.8
man/systemd-readahead-done.timer.8: man/systemd-readahead-replay.service.8
man/systemd-readahead.8: man/systemd-readahead-replay.service.8
man/systemd-readahead-collect.service.html: man/systemd-readahead-replay.service.html
$(html-alias)
man/systemd-readahead-done.service.html: man/systemd-readahead-replay.service.html
$(html-alias)
man/systemd-readahead-done.timer.html: man/systemd-readahead-replay.service.html
$(html-alias)
man/systemd-readahead.html: man/systemd-readahead-replay.service.html
$(html-alias)
endif
if ENABLE_RESOLVED
MANPAGES += \
man/dnssec-trust-anchors.d.5 \
@@ -2658,6 +2686,7 @@ EXTRA_DIST += \
man/sd-id128.xml \
man/sd-journal.xml \
man/sd-login.xml \
man/sd-readahead.xml \
man/sd_booted.xml \
man/sd_bus_add_match.xml \
man/sd_bus_creds_get_pid.xml \
@@ -2727,6 +2756,7 @@ EXTRA_DIST += \
man/sd_machine_get_class.xml \
man/sd_notify.xml \
man/sd_pid_get_session.xml \
man/sd_readahead.xml \
man/sd_seat_get_active.xml \
man/sd_session_is_active.xml \
man/sd_uid_get_state.xml \
@@ -2783,6 +2813,7 @@ EXTRA_DIST += \
man/systemd-path.xml \
man/systemd-quotacheck.service.xml \
man/systemd-random-seed.service.xml \
man/systemd-readahead-replay.service.xml \
man/systemd-remount-fs.service.xml \
man/systemd-resolve.xml \
man/systemd-resolved.service.xml \
View
@@ -971,6 +971,7 @@ libshared_la_SOURCES = \
src/shared/udev-util.h \
src/shared/linux/auto_dev-ioctl.h \
src/shared/linux-3.13/dm-ioctl.h \
src/shared/linux/fanotify.h \
src/shared/initreq.h \
src/shared/dns-domain.c \
src/shared/dns-domain.h \
@@ -3053,7 +3054,8 @@ systemctl_LDADD = \
# ------------------------------------------------------------------------------
systemd_notify_SOURCES = \
src/notify/notify.c
src/notify/notify.c \
src/readahead/sd-readahead.c
systemd_notify_LDADD = \
libsystemd-shared.la
@@ -4680,6 +4682,57 @@ EXTRA_DIST += \
src/vconsole/90-vconsole.rules.in \
units/systemd-vconsole-setup.service.in
# ------------------------------------------------------------------------------
if ENABLE_READAHEAD
systemd_readahead_SOURCES = \
src/readahead/readahead.c \
src/readahead/readahead-collect.c \
src/readahead/readahead-replay.c \
src/readahead/readahead-analyze.c \
src/readahead/readahead-common.c \
src/readahead/readahead-common.h
systemd_readahead_LDADD = \
libsystemd-internal.la \
libudev-internal.la \
libshared.la
dist_doc_DATA += \
src/readahead/sd-readahead.c \
src/systemd/sd-readahead.h
rootlibexec_PROGRAMS += \
systemd-readahead
dist_systemunit_DATA += \
units/systemd-readahead-drop.service \
units/systemd-readahead-done.timer
nodist_systemunit_DATA += \
units/systemd-readahead-collect.service \
units/systemd-readahead-replay.service \
units/systemd-readahead-done.service
manual_tests += \
test-ssd
test_ssd_SOURCES = \
src/readahead/test-ssd.c \
src/readahead/readahead-common.c \
src/readahead/readahead-common.h
test_ssd_LDADD = \
libsystemd-internal.la \
libudev-internal.la \
libshared.la
endif
EXTRA_DIST += \
units/systemd-readahead-collect.service.in \
units/systemd-readahead-replay.service.in \
units/systemd-readahead-done.service.in
# ------------------------------------------------------------------------------
if ENABLE_QUOTACHECK
rootlibexec_PROGRAMS += \
View
1 README
@@ -33,6 +33,7 @@ LICENSE:
- except src/basic/siphash24.c which is CC0 Public Domain
- except src/journal/lookup3.c which is Public Domain
- except src/udev/* which is (currently still) GPLv2, GPLv2+
- except sd-readahead.[ch] which is MIT
REQUIREMENTS:
Linux kernel >= 3.13
View
7 TODO
@@ -863,6 +863,13 @@ External:
- <command> <verb> -<TAB> should complete options, but currently does not
- systemctl add-wants,add-requires
* readahead:
- drop /.readahead on bigger upgrades with yum
- move readahead files into /var (look for them with .path units?)
- readahead: use BTRFS_IOC_DEFRAG_RANGE instead of BTRFS_IOC_DEFRAG ioctl, with START_IO
- readahead: when bumping /sys readahead variable save mtime and compare later to detect changes
- readahead: make use of EXT4_IOC_MOVE_EXT, as used by http://e4rat.sourceforge.net/
Regularly:
View
@@ -299,6 +299,7 @@ CAP_LIBS="$LIBS"
LIBS="$save_LIBS"
AC_SUBST(CAP_LIBS)
AC_CHECK_FUNCS([fanotify_init fanotify_mark])
AC_CHECK_FUNCS([__secure_getenv secure_getenv])
AC_CHECK_DECLS([
memfd_create,
@@ -989,6 +990,14 @@ if test "x$enable_vconsole" != "xno"; then
fi
AM_CONDITIONAL(ENABLE_VCONSOLE, [test "$have_vconsole" = "yes"])
# ------------------------------------------------------------------------------
have_readahead=no
AC_ARG_ENABLE(readahead, AS_HELP_STRING([--disable-readahead], [disable readahead tools]))
if test "x$enable_readahead" != "xno"; then
have_readahead=yes
fi
AM_CONDITIONAL(ENABLE_READAHEAD, [test "$have_readahead" = "yes"])
# ------------------------------------------------------------------------------
have_quotacheck=no
AC_ARG_ENABLE(quotacheck, AS_HELP_STRING([--disable-quotacheck], [disable quotacheck tools]))
@@ -1618,6 +1627,7 @@ AC_MSG_RESULT([
ELFUTILS: ${have_elfutils}
binfmt: ${have_binfmt}
vconsole: ${have_vconsole}
readahead: ${have_readahead}
quotacheck: ${have_quotacheck}
tmpfiles: ${have_tmpfiles}
sysusers: ${have_sysusers}
View
@@ -137,6 +137,7 @@
<citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>fprintf</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd-readahead</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
</para>
</refsect1>
View
@@ -128,6 +128,7 @@
<citerefentry><refentrytitle>sd_get_seats</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_login_monitor_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd-daemon</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd-readahead</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
</para>
</refsect1>
View
@@ -0,0 +1,117 @@
<?xml version='1.0'?> <!--*-nxml-*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!--
This file is part of systemd.
Copyright 2010 Lennart Poettering
systemd is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
<refentry id="sd-readahead" conditional='ENABLE_READAHEAD'>
<refentryinfo>
<title>sd-readahead</title>
<productname>systemd</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>
<firstname>Lennart</firstname>
<surname>Poettering</surname>
<email>lennart@poettering.net</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta>
<refentrytitle>sd-readahead</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
<refname>sd-readahead</refname>
<refpurpose>Reference implementation of APIs for
controlling boot-time read-ahead</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include "sd-readahead.h"</funcsynopsisinfo>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para><filename>sd-readahead.c</filename> and
<filename>sd-readahead.h</filename> provide a
reference implementation for APIs for controlling boot-time
read-ahead, as implemented by the read-ahead subsystem
of the
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
init system.</para>
<para>See
<citerefentry><refentrytitle>sd_readahead</refentrytitle><manvolnum>3</manvolnum></citerefentry>
for more information about the function
implemented.</para>
</refsect1>
<refsect1>
<title>Notes</title>
<para>This interface is provided by the reference
implementation of APIs for controlling boot-time
read-ahead and distributed with the systemd
package. The algorithms it implements are simple, and
can easily be reimplemented in daemons if it is
important to support this interface without using the
reference implementation. See the respective function
man pages for details.</para>
<para>In addition, for details about the algorithms,
check the liberally licensed reference implementation
sources:
<ulink url="http://cgit.freedesktop.org/systemd/systemd/plain/src/readahead/sd-readahead.c"/>
and <ulink url="http://cgit.freedesktop.org/systemd/systemd/plain/src/systemd/sd-readahead.h"/></para>
<para>These APIs are implemented in the reference
implementation's drop-in
<filename>sd-readahead.c</filename> and
<filename>sd-readahead.h</filename> files. It is
recommended that applications consuming these APIs copy
the implementation into their source tree, either
verbatim or in excerpts. These interfaces are
currently not available in a dynamic library.</para>
<para>The functions provided by this interface become
NOPs when -DDISABLE_SYSTEMD is set during
compilation. In addition, if
<filename>sd-readhead.c</filename> is compiled on
non-Linux systems it becomes NOPs.</para>
</refsect1>
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_readahead</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd-daemon</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>
Oops, something went wrong.

0 comments on commit bbdd3e2

Please sign in to comment.