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>