* PATCH 2.4.0.11.3: sysctl.h fixes
@ 2000-11-12 14:30 Jeff Garzik
2000-11-12 23:02 ` Neil Brown
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Garzik @ 2000-11-12 14:30 UTC (permalink / raw)
To: Linus Torvalds; +Cc: viro, Rasmus Andersen, linux-kernel
Rasmus Andersen wrote:
> I tried to include <linux/types.h> in md.c and had to include
> <linux/blkdev.h> also. Otherwise I got the following:
Here is the solution I prefer... md builds fine with this, core kernel builds fine with this, and
I'm about 3/4 of the way through a "build everything" build with this.
I tried to avoid including fs.h, but I do prefer updating sysctl.h, because it fixes potential
breakage similar to md's as well.
Jeff
Index: include/linux/sysctl.h
===================================================================
RCS file: /cvsroot/gkernel/linux_2_4/include/linux/sysctl.h,v
retrieving revision 1.1.1.8
diff -u -r1.1.1.8 sysctl.h
--- include/linux/sysctl.h 2000/10/31 21:19:40 1.1.1.8
+++ include/linux/sysctl.h 2000/11/12 14:28:04
@@ -24,7 +24,11 @@
#ifndef _LINUX_SYSCTL_H
#define _LINUX_SYSCTL_H
+#include <linux/kernel.h>
+#include <linux/types.h>
#include <linux/list.h>
+
+struct file;
#define CTL_MAXNAME 10
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: PATCH 2.4.0.11.3: sysctl.h fixes
2000-11-12 14:30 PATCH 2.4.0.11.3: sysctl.h fixes Jeff Garzik
@ 2000-11-12 23:02 ` Neil Brown
2000-11-12 23:28 ` Jeff Garzik
0 siblings, 1 reply; 3+ messages in thread
From: Neil Brown @ 2000-11-12 23:02 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Linus Torvalds, viro, Rasmus Andersen, linux-kernel
On Sunday November 12, jgarzik@mandrakesoft.com wrote:
> Rasmus Andersen wrote:
> > I tried to include <linux/types.h> in md.c and had to include
> > <linux/blkdev.h> also. Otherwise I got the following:
>
> Here is the solution I prefer... md builds fine with this, core kernel builds fine with this, and
> I'm about 3/4 of the way through a "build everything" build with this.
>
> I tried to avoid including fs.h, but I do prefer updating sysctl.h, because it fixes potential
> breakage similar to md's as well.
>
> Jeff
>
The declaration of:
struct file;
in sysctl.h is a bit counter intuitive isn't it?
I avoided the problem with:
--- md.c 2000/11/12 23:00:49 1.1
+++ md.c 2000/11/12 23:00:53
@@ -30,8 +30,8 @@
#include <linux/module.h>
#include <linux/config.h>
-#include <linux/sysctl.h>
#include <linux/raid/md.h>
+#include <linux/sysctl.h>
#include <linux/raid/xor.h>
#include <linux/devfs_fs_kernel.h>
It is certainly arguable that a better fix is to add some extra
includes to sysctl.h, but the "struct file;" bothers me.
NeilBrown
>
>
>
> Index: include/linux/sysctl.h
> ===================================================================
> RCS file: /cvsroot/gkernel/linux_2_4/include/linux/sysctl.h,v
> retrieving revision 1.1.1.8
> diff -u -r1.1.1.8 sysctl.h
> --- include/linux/sysctl.h 2000/10/31 21:19:40 1.1.1.8
> +++ include/linux/sysctl.h 2000/11/12 14:28:04
> @@ -24,7 +24,11 @@
> #ifndef _LINUX_SYSCTL_H
> #define _LINUX_SYSCTL_H
>
> +#include <linux/kernel.h>
> +#include <linux/types.h>
> #include <linux/list.h>
> +
> +struct file;
>
> #define CTL_MAXNAME 10
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> Please read the FAQ at http://www.tux.org/lkml/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: PATCH 2.4.0.11.3: sysctl.h fixes
2000-11-12 23:02 ` Neil Brown
@ 2000-11-12 23:28 ` Jeff Garzik
0 siblings, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2000-11-12 23:28 UTC (permalink / raw)
To: Neil Brown; +Cc: Linus Torvalds, viro, Rasmus Andersen, linux-kernel
Neil Brown wrote:
> The declaration of:
>
> struct file;
>
> in sysctl.h is a bit counter intuitive isn't it?
Nope. It's a useful technique that I was reminded of recently by DaveM.
Have you ever looked at the -nasty- include nesting that occurs because
key kernel headers include other key kernel headers all the time? Its
way past time to reverse that trend. Using "struct foo;" at the
beginning of the header simply passes on the task of including the
definiton for 'struct foo' down the line, avoiding another level of
include nesting.
But... that said. Provided no other kernel code is similarly broken,
your fix to md.c, Neil, is definitely superior to adding includes and
'struct file;' to sysctl.h.
Jeff
--
Jeff Garzik |
Building 1024 | Would you like a Twinkie?
MandrakeSoft |
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2000-11-12 23:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-11-12 14:30 PATCH 2.4.0.11.3: sysctl.h fixes Jeff Garzik
2000-11-12 23:02 ` Neil Brown
2000-11-12 23:28 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox