From: Andreas Dilger <adilger@shaw.ca>
To: linux-kernel@schatzie.adilger.int, linux-fsdevel@vger.kernel.org,
Adrian's Trivial Patches <trivial@rustcorp.com.au>,
Andrew Morton <akpm@osdl.org>
Subject: [PATCH] reserve space for swap label
Date: Sun, 23 Apr 2006 01:28:57 -0600 [thread overview]
Message-ID: <20060423072857.GN6075@schatzie.adilger.int> (raw)
The following patch reserves space in the swap disk header for a LABEL and
UUID to be specified. This has been possible with util-linux-2.12b (via
e2fsprogs 1.36 libblkid), and is used by at least FC3 and later. The kernel
doesn't really care about this, but the space shouldn't accidentally be used
by something else either.
It also makes the on-disk structures be fixed-size types, instead of "int",
though I don't know of any architecture in use where an "int" isn't the
same size as a "__u32" (all current kernel arches have it as "unsigned int").
Signed-off-by: Andreas Dilger <adilger@shaw.ca>
--- ./include/linux/swap.h.orig 2005-06-17 13:48:29.000000000 -0600
+++ ./include/linux/swap.h 2006-04-23 01:01:47.000000000 -0600
@@ -48,12 +48,14 @@
char magic[10]; /* SWAP-SPACE or SWAPSPACE2 */
} magic;
struct {
- char bootbits[1024]; /* Space for disklabel etc. */
- unsigned int version;
- unsigned int last_page;
- unsigned int nr_badpages;
- unsigned int padding[125];
- unsigned int badpages[1];
+ char bootbits[1024]; /* Space for disklabel etc. */
+ __u32 version;
+ __u32 last_page;
+ __u32 nr_badpages;
+ unsigned char sws_uuid[16];
+ unsigned char sws_volume[16];
+ __u32 padding[117];
+ __u32 badpages[1];
} info;
};
Cheers, Andreas
--
Andreas Dilger
reply other threads:[~2006-04-23 7:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060423072857.GN6075@schatzie.adilger.int \
--to=adilger@shaw.ca \
--cc=akpm@osdl.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@schatzie.adilger.int \
--cc=trivial@rustcorp.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).