sd_readahead.xml revision 56ba3c78ae35065064c4289a0c8e22a81256af20
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames This file is part of systemd.
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames Copyright 2010 Lennart Poettering
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames systemd is free software; you can redistribute it and/or modify it
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames under the terms of the GNU Lesser General Public License as published by
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames the Free Software Foundation; either version 2.1 of the License, or
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames (at your option) any later version.
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames systemd is distributed in the hope that it will be useful, but
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames WITHOUT ANY WARRANTY; without even the implied warranty of
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames Lesser General Public License for more details.
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames You should have received a copy of the GNU Lesser General Public License
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames along with systemd; If not, see <http://www.gnu.org/licenses/>.
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames<refentry id="sd_notify" conditional='ENABLE_READAHEAD'>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames <refentryinfo>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames <authorgroup>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames </authorgroup>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames </refentryinfo>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames <refnamediv>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames <refpurpose>Control ongoing disk boot-time read-ahead operations</refpurpose>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames </refnamediv>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames <refsynopsisdiv>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames <funcsynopsis>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames <funcsynopsisinfo>#include "sd-readahead.h"</funcsynopsisinfo>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames <funcprototype>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames <funcdef>int <function>sd_readahead</function></funcdef>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames <paramdef>const char *<parameter>action</parameter></paramdef>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames </funcprototype>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames </funcsynopsis>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames </refsynopsisdiv>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames called by programs involved with early boot-up to
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames control ongoing boot-time disk read-ahead operations. It may be
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames used to terminate read-ahead operations in case an
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames uncommon disk access pattern is to be expected and
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames hence read-ahead replay or collection is unlikely to
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames have the desired speed-up effect on the current or
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames future boot-ups.</para>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames <para>The <parameter>action</parameter> should be one
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames of the following strings:</para>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames <variablelist>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames <varlistentry>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames data collection, and drops all
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames read-ahead data collected during this
43162230430f8144afe9c32cd0e60b927f4e0a60gregames </varlistentry>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames <varlistentry>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames data collection, but keeps all
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames read-ahead data collected during this
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames boot-up around for use during
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames </varlistentry>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames <varlistentry>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames </varlistentry>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames </variablelist>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames </refsect1>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames <para>On failure, these calls return a negative
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames errno-style error code. It is generally recommended to
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames ignore the return value of this call.</para>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames </refsect1>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames <para>This function is provided by the reference
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames implementation of APIs for controlling boot-time
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames read-ahead and distributed with the systemd
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames package. The algorithm it implements is simple, and
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames can easily be reimplemented in daemons if it is
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames important to support this interface without using the
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames reference implementation.</para>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames <para>Internally, this function creates a file in
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames <filename>/run/systemd/readahead/</filename> which is
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames then used as flag file to notify the read-ahead
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames subsystem.</para>
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames <para>For details about the algorithm check the
3d0434b7f8ce3bfce252ebbe3cabe626ba750d83gregames liberally licensed reference implementation sources: