]> git.ipfire.org Git - thirdparty/util-linux.git/commit - sys-utils/swapon.c
swapon: add swap format detection and pagesize check
authorMatthias Koenig <mkoenig@suse.de>
Thu, 27 Nov 2008 11:32:56 +0000 (12:32 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 5 Dec 2008 11:54:12 +0000 (12:54 +0100)
commit3399a218f4eff4016a22044e7c416521bc37c53c
treeaa9fa55c4473d435a0d35238c2834377246b940e
parentd60819b36d1a9fcb6c0f9678b6549cd7810d0943
swapon: add swap format detection and pagesize check

As swap format depends on the pagesize being used, it may happen
that the pagesize of the swap space and the current pagesize differ,
resulting in swapon to fail when trying to enable such a swap space.
In such a case swapon should rather reinitialize the swap space.

[kzak@redhat.com: - add blkdev.c to the global swapon_SOURCES
                  - don't try to detect for huge pages on small swap
                    areas (or when read() returns less than MAX_PAGESIZE)
                  - fix fprintf() format string]

Co-Author: Olaf Hering <olh@suse.de>
Signed-off-by: Matthias Koenig <mkoenig@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
mount/Makefile.am
mount/swapon.c