Applied patch from Ricky Ng-Adam for systems using tmpfs:
========================================================
Tests swapon01, swapon02, swapoff01, swapoff02 FAILED for me until I
realized that my /tmp where the swapfiles where being created was set as
a tmpfs (in-memory) filesystem. Swapon will refuse to work with an
EINVAL as it should.
To help people figure this out faster in the future, this patch and two
extra functions for LTP libs are to make these tests fail with a more
informative message when attempts to create swap on tmpfs are made.
Also, I've added a test to check if there is sufficient disk space on
the filesystem to create the requested swap (except for swapon02.c where
I can't figure how much space total the test will require).
5 files changed