According to the manpage I have on swapon, there is an option:
-s Display swap usage summary by device
Unfortunately, when I try it, it doesn't work... (something about
/proc/swaps not being there... I haven't looked at the cause of that).
However, I figure that there is a way to find the (current) files that
are used for swap in some other way (how else would swapoff know what to
swap off?), so the thing that can be used then is looking at the inode
numbers of all the files that are currently used for swapping and
comparing those with the inode number of the new file that is given
to swapon.
This fails if you don't check the partition they're on, but that's just
another check too...
Make sense?
(I could be totally out to lunch on this, since I haven't looked at any
actual code yet.)
CHeers,
Gert-Jan.
+++++++++++++ -------- +++++ --- ++ - + 0 + + ++ +++ +++++ ++++++++ +++++++++++++
sed '/^[when][coders]/!d G.J.W. Hagenaars -- Product Dial Architect
/^...[discover].$/d Remembering Mike Carty 1968-1994
/^..[real].[code]$/!d gj at shell dot istar dot ca
' /usr/dict/words I'm Dutch, what's _your_ excuse?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu