]> git.ipfire.org Git - thirdparty/util-linux.git/commit
swapon: allow a more flexible swap discard policy
authorRafael Aquini <aquini@redhat.com>
Sun, 26 May 2013 04:31:56 +0000 (01:31 -0300)
committerKarel Zak <kzak@redhat.com>
Fri, 23 Aug 2013 10:50:39 +0000 (12:50 +0200)
commitd6387c98cb0e0811aafbfdff09256ce2ff7742e4
tree15a28a2eed87ac8dcf89cfc049fa8269bbc6fc7b
parentb86727542f24c750414a742d2599da1dad9fafa2
swapon: allow a more flexible swap discard policy

Introduce the necessary changes to swapon(8) allowing a sysadmin to leverage
the new changes introduced to sys_swapon by "swap: discard while swapping
only if SWAP_FLAG_DISCARD_PAGES", therefore allowing a more flexible set of
choices when selection the discard policy for mounted swap areas.
This patch introduces the following optional arguments to the already
existent swapon(8) "--discard" option, in order to allow a discard type to
be selected at swapon time:
 * once    : only single-time area discards are issued. (swapon)
 * pages   : discard freed pages before they are reused.
If no policy is selected both discard types are enabled. (default)

[kzak@redhat.com: - support <policy> argument for short -d option too,
                  - add errx() on unsupported policy name]

Signed-off-by: Rafael Aquini <aquini@redhat.com>
Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/swapon.8
sys-utils/swapon.c