[patch] size optimization for mkswap.c

Rob Landley rob at landley.net
Thu Mar 16 12:18:50 PST 2006


On Thursday 16 March 2006 9:06 am, Bernhard Fischer wrote:
> Forgot to mention these:
> >+config CONFIG_FEATURE_MKSWAP_V0
> >+	bool "  version 0 support"
> >+	default n
> >+	depends on CONFIG_MKSWAP
> >+#	depends on CONFIG_MKSWAP && CONFIG_DEPRECATED
>
> Should we add something like CONFIG_DEPRECATED for trunk (i.e. for 1.2)?

Now that we have a Busybox Settings menu, we should add a menu of deprecated 
stuff under it.  We probably don't need a separate deprecated tag.


> >+	help
> >+	  Enable support for the old v0 style.
> >+	  If your kernel is older than 2.1.117, then v0 support is the
> >+	  only option.
> >
> >
> >-	version = atoi(tmp);
> >+	USE_FEATURE_MKSWAP_V0(version = atoi(tmp);)
> >+	SKIP_FEATURE_MKSWAP_V0(if (00 && sz & 4)
> >+			bb_error_msg_and_die("No v0 support");)
>
> This verbose check would add about 28 Bytes to inform the user that v0
> support is not available. Not sure if we want that.

The new swapfile format was introduced for the 2.2 kernel, which has now 
fallen off the low-end of what we support.  If we support the -v flag at all 
we should ignore it.

I'd chop v0 support out entirely.  It's beyond deprecated, it's obsolete (as 
far as busybox is concerned).

> If v0 is disabled and the user requests it, then we could as well
> silently create a v1 style swap. By careful inspection, the user would
> notice the version anyway as it prints:
> Setting up swapspace version 1, size = xyz bytes

We can just say "setting up swapspace", no need to even mention version.  ext2 
replaced the old ext, and SWAPSPACE2 has replaced the old kind.  (And it's 
confusing that -v1 is SWAPSPACE2.  Let's not go there.)

Rob
-- 
Never bet against the cheap plastic solution.


More information about the busybox mailing list