From: Glenn McGrath <bug1@optushome.com.au>
To: linux-kernel@vger.kernel.org
Cc: Erik Andersen <andersen@codepoet.org>
Date: Wed, 20 Mar 2002 23:53:38 +1100 [thread overview]
Message-ID: <20020320235338.0b0239bb.bug1@optushome.com.au> (raw)
[-- Attachment #1: Type: text/plain, Size: 553 bytes --]
This patch moves some defines from within the body of functions that
handle sub msdos partion types (bsd, solaris, unixware, minix) to outside
the function, and places defines around their entry in the table that maps
where they are called from. It will usually save around 100 Bytes, it isnt
much, but i dont see any reason to define a function that does nothing.
Im having trouble trying to subscribe to the lkml or get to
http://vger.kernel.org, (maybe an ECN problem?) so if anyone does get this
and wants to respond please cc me.
Thanks
Glenn
[-- Attachment #2: part.msdos.defines.diff --]
[-- Type: text/plain, Size: 3228 bytes --]
--- linux-2.5.7.orig/fs/partitions/msdos.c Tue Mar 19 07:37:04 2002
+++ linux-2.5.7/fs/partitions/msdos.c Wed Mar 20 22:25:31 2002
@@ -207,15 +207,13 @@
put_dev_sector(sect);
}
+#ifdef CONFIG_SOLARIS_X86_PARTITION
/* james@bpgc.com: Solaris has a nasty indicator: 0x82 which also
indicates linux swap. Be careful before believing this is Solaris. */
-
static void
solaris_x86_partition(struct gendisk *hd, struct block_device *bdev,
int minor, int *current_minor)
{
-
-#ifdef CONFIG_SOLARIS_X86_PARTITION
long offset = hd->part[minor].start_sect;
Sector sect;
struct solaris_x86_vtoc *v;
@@ -257,8 +255,8 @@
}
put_dev_sector(sect);
printk(" >\n");
-#endif
}
+#endif
#ifdef CONFIG_BSD_DISKLABEL
/*
@@ -304,33 +302,34 @@
}
#endif
+#ifdef CONFIG_BSD_DISKLABEL
static void bsd_partition(struct gendisk *hd, struct block_device *bdev,
int minor, int *current_minor)
{
-#ifdef CONFIG_BSD_DISKLABEL
do_bsd_partition(hd, bdev, minor, current_minor, "bsd",
BSD_MAXPARTITIONS);
-#endif
}
+#endif
+#ifdef CONFIG_BSD_DISKLABEL
static void netbsd_partition(struct gendisk *hd, struct block_device *bdev,
int minor, int *current_minor)
{
-#ifdef CONFIG_BSD_DISKLABEL
do_bsd_partition(hd, bdev, minor, current_minor, "netbsd",
BSD_MAXPARTITIONS);
-#endif
}
+#endif
+#ifdef CONFIG_BSD_DISKLABEL
static void openbsd_partition(struct gendisk *hd, struct block_device *bdev,
int minor, int *current_minor)
{
-#ifdef CONFIG_BSD_DISKLABEL
do_bsd_partition(hd, bdev, minor, current_minor,
"openbsd", OPENBSD_MAXPARTITIONS);
-#endif
}
+#endif
+#ifdef CONFIG_UNIXWARE_DISKLABEL
/*
* Create devices for Unixware partitions listed in a disklabel, under a
* dos-like partition. See extended_partition() for more information.
@@ -338,7 +337,6 @@
static void unixware_partition(struct gendisk *hd, struct block_device *bdev,
int minor, int *current_minor)
{
-#ifdef CONFIG_UNIXWARE_DISKLABEL
long offset = hd->part[minor].start_sect;
Sector sect;
struct unixware_disklabel *l;
@@ -370,9 +368,10 @@
}
put_dev_sector(sect);
printk(" >\n");
-#endif
}
+#endif
+#ifdef CONFIG_MINIX_SUBPARTITION
/*
* Minix 2.0.0/2.0.2 subpartition support.
* Anand Krishnamurthy <anandk@wiproge.med.ge.com>
@@ -381,7 +380,6 @@
static void minix_partition(struct gendisk *hd, struct block_device *bdev,
int minor, int *current_minor)
{
-#ifdef CONFIG_MINIX_SUBPARTITION
long offset = hd->part[minor].start_sect;
Sector sect;
unsigned char *data;
@@ -416,19 +414,27 @@
printk(" >\n");
}
put_dev_sector(sect);
-#endif /* CONFIG_MINIX_SUBPARTITION */
}
+#endif /* CONFIG_MINIX_SUBPARTITION */
static struct {
unsigned char id;
void (*parse)(struct gendisk *, struct block_device *, int, int *);
} subtypes[] = {
+#ifdef CONFIG_BSD_DISKLABEL
{BSD_PARTITION, bsd_partition},
{NETBSD_PARTITION, netbsd_partition},
{OPENBSD_PARTITION, openbsd_partition},
+#endif
+#ifdef CONFIG_MINIX_SUBPARTITION
{MINIX_PARTITION, minix_partition},
+#endif
+#ifdef CONFIG_UNIXWARE_DISKLABEL
{UNIXWARE_PARTITION, unixware_partition},
+#endif
+#ifdef CONFIG_SOLARIS_X86_PARTITION
{SOLARIS_X86_PARTITION, solaris_x86_partition},
+#endif
{0, NULL},
};
/*
reply other threads:[~2002-03-20 12:54 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=20020320235338.0b0239bb.bug1@optushome.com.au \
--to=bug1@optushome.com.au \
--cc=andersen@codepoet.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®