summaryrefslogtreecommitdiffstats
path: root/mount/swapon.8
diff options
context:
space:
mode:
authorHugh Dickins2010-10-25 02:32:47 +0200
committerKarel Zak2010-11-01 16:35:31 +0100
commitc2301380b4d61921971f89661088d1dab7c70ccd (patch)
tree249f6a38adda7ec24d70cab99b9f09ac46e613b2 /mount/swapon.8
parentrev: use xalloc for memory allocation (diff)
downloadkernel-qcow2-util-linux-c2301380b4d61921971f89661088d1dab7c70ccd.tar.gz
kernel-qcow2-util-linux-c2301380b4d61921971f89661088d1dab7c70ccd.tar.xz
kernel-qcow2-util-linux-c2301380b4d61921971f89661088d1dab7c70ccd.zip
swapon: add "discard" support
In kernel 2.6.36 (and in stable kernel 2.6.35.5) I made a tiny change to the swapon(const char *path, int swapflags) system call interface: kernel commit 3399446632739fcd05fd8b272b476a69c6e6d14a swap: discard while swapping only if SWAP_FLAG_DISCARD As things stand at present, we could just remove the swap discard support; but since several filesystems (including ext4 and btrfs and fat) are offering a "discard" mount option, I thought swap should take the same course, and offer a "--discard" or "-d" option to swapon(8). [kzak@redhat.com: - update swapon.8 man page - use for -d the same logic as for -p] Signed-off-by: Hugh Dickins <hughd@google.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'mount/swapon.8')
-rw-r--r--mount/swapon.811
1 files changed, 11 insertions, 0 deletions
diff --git a/mount/swapon.8 b/mount/swapon.8
index 595198d51..e35c6e5f5 100644
--- a/mount/swapon.8
+++ b/mount/swapon.8
@@ -54,6 +54,7 @@ Enable/disable:
.br
.in +5
.B swapon
+.RB [ \-d ]
.RB [ \-f ]
.RB [ \-p
.IR priority ]
@@ -111,6 +112,16 @@ All devices marked as ``swap'' in
are made available, except for those with the ``noauto'' option.
Devices that are already being used as swap are silently skipped.
.TP
+.B "\-d, \-\-discard"
+Swapping will discard clusters of swap pages in between freeing them
+and re-writing to them, if the swap device supports that.
+The
+.I /etc/fstab
+mount option
+.BI discard
+may be also used to enable discard flag.
+
+.TP
.B "\-e, \-\-ifexists"
Silently skip devices that do not exist.
The