Skip to contentSkip to conversation

swapon feature additions

DISCUSSION Dave Reisner 2 participants 2 messages Oct 27, 2011 – Nov 3, 2011 Util-Linux package

lore
Share & tools
lore
#0 lore raw

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

maintainer
#1 lore raw
Quoted 4 lines · Dave Reisner

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.

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