[PATCH] size reduction and clean up swaponoff.c
Mike Frysinger
vapier at gentoo.org
Fri Sep 16 04:50:49 UTC 2005
On Wednesday 14 September 2005 11:12 am, Rob Landley wrote:
> On Monday 12 September 2005 21:26, Mike Frysinger wrote:
> > unrelated to this patch, and minor overall, but our swap utils different
> > from normal in that:
> > - normal swap utils accept unlimited paths
> > swapon /dev/hda1 /dev/hda2 /dev/hdb2
> > - normal swap utils dont complain when you run with -a
> > swapon -a
> > swapon -a
> > swapoff -a
> > swapoff -a
> >
> > these are trivial to fix, but they are trivial in and of themselves ...
> > anyone think i should bother committing these ?
>
> Hmmm... The first one's a correctness issue.
fixed ... only added like 20 bytes to the object file :)
> The second one is actually that I think we have better error reporting than
> the standard one. On the other hand, from a usability perspective... It's
> possible for our init to call swapon in low memory situations and then for
> the init scripts to do so on TOP of that, and this probably shouldn't be
> reported as an error...
if they really care they could just pipe into /dev/null
> Testing a bit, swapon /dev/walrus gives an error message, and
> adding /dev/walrus as a swap entry swapon -a also gives an error message,
> so it's definitely specifically suppressing that error...
the behavior (afaictl) is that the -a arguments will not report an error if
the swap device is in the proper state ...
so if you run `swapoff -a`, it will not report an error if the device
in /etc/fstab is already off ... if the device does not exist or is otherwise
invalid, an error will be reported
same goes for `swapon -a` ... all normal errors are reported except if the
device specified in /etc/fstab is already enabled for swap
> I can go either way on the second. Depends how big it is. By all means,
> please fix the first, that's a correctness issue...
we're talking a rough range of 30-40 additional bytes on an amd64 host ... it
isnt a feature i would require in busybox considering it's merely cosmetic
one, but i would require in the 'full' featured one from util-linux
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: silent-swap.patch
Type: text/x-diff
Size: 913 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20050916/1fb12666/attachment.bin
More information about the busybox
mailing list