[klibc] bunch of small fixes

Nigel Cunningham ncunningham at crca.org.au
Fri Mar 28 15:50:08 PDT 2008


Hi.

On Fri, 2008-03-28 at 21:32 +0100, maximilian attems wrote:
> hello hpa,
> 
> updated/rebased my klibc merge branch.
> 
> David critized the toxonice fstype support due to the
> missing real MAGIC of tuxonice. I agree that "z" and "Z"
> leaves too much room for misrecognition thus patch dropped.
> added a quick utils cleanup and a mknod switch.

Thanks for cc'ing me. The reason it is just a 'z' or 'Z' is that it
hasn't changed since the days when we had to fit major & minor numbers,
a block and the block size. (There simply wasn't room for anything more
than one character). Since you've raised the issue, I've had another
look. The format is currently:

Byte 0:     z/Z: Original swapspace type.
     1-4:   dev_t for first block of header
     5:     blocksize - top bit = whether previously attempted to resume
     6-9:   index of first block of header

The dev_t is necessary because (unlike [u]swsusp), we support using
multiple swap devices for storing the image, so the header might start
on a different partition to the swapspace signature.

Clearly there are some unused bits in there now. How about if I
rearranged things:

Bytes 0-1:   Signature ascii tx with the high bit on in
             Byte 0 if the original signature was SWAPSPACE2.
             Byte 1 if we tried to resume before.
      2-5:   dev_t for first block  of header
      6-9:   index for first block of header

Would that help address the potential misrecognition issue?

Nigel



More information about the klibc mailing list