swapon feature additions
Hi Karel,
I was interested in making a few changes to swapon, but I figured I'd inquire as to whether or not they're welcome first.
1) Introduce optional libmount support. This involves first refactoring reading of /etc/fstab to remove the duplicated code and use callbacks instead. Breaking out the functionality into libmount-powered and non-libmount-powered code is then much cleaner.
2) Teach swapon/swapoff to only look at files or partitions. The use case in mind is specifically for unswapping only files at shutdown, as partitions can remain mounted without harm.
Does this seem reasonable? Is this functionality wanted? Anything else I should be aware of?
Thanks,
Dave Reisner
Karel Zak
maintainerQuoted 4 lines · Dave Reisner
1) Introduce optional libmount support. This involves first refactoring reading of
/etc/fstabto remove the duplicated code and use callbacks instead. Breaking out the functionality into libmount-powered and non-libmount-powered code is then much cleaner.
I'd like to move all swapon(8) functionality to libmount and replace the whole swapon(8) by a small libmount based util. Unfortunately, swapon/swapoff support in libmount is not implemented yet.
Quoted 3 lines
2) Teach swapon/swapoff to only look at files or partitions. The use case in mind is specifically for unswapping only files at shutdown, as partitions can remain mounted without harm.
This is probably more important, it would be nice to have
swapoff --all --files-only
Quoted 2 lines
Does this seem reasonable? Is this functionality wanted? Anything else I should be aware of?
Yes, my suggestion is to start with 2) :-)
Karel
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com