]> git.ipfire.org Git - thirdparty/util-linux.git/commit
swapon: rewrite control struct usage
authorKarel Zak <kzak@redhat.com>
Fri, 18 Mar 2016 13:28:29 +0000 (14:28 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 18 Mar 2016 13:28:29 +0000 (14:28 +0100)
commit6c44094af621c011135e758b0d5e175dfe344e90
tree88bc30a644bcd33fc9ca60bc021813fdc10cc830
parent54a0d5861ffc97dc5523764cab920adcf4e0c366
swapon: rewrite control struct usage

The old version has been pretty broken... the most important is to
keep swap options specified on command line as read-only template.
For example if we call "swapon --all" then we cannot modify the global
options for each fstab swap entry.

The another story has been control struct modification due to device
reinitialization etc.

This patch splits all to:

* struct swapon_control; top-level struct with command line options

* struct swap_device; this is device specific and never globally
  maintained by swapon_control.

* struct swap_prop; used as global read-only template swap options
  and per device swap options (when parse fstab).

Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=818252
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/swapon.8
sys-utils/swapon.c