PATCH 2.4.0.11.3: sysctl.h fixes
Quoted 2 lines · Rasmus Andersen
I tried to include <
linux/types.h> inmd.cand 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
linux/sysctl.h +4 -0
@@ -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 [email protected]
Please read the FAQ at http://www.tux.org/lkml/
Quoted 5 lines · Neil Brown
The declaration of:
struct file;
in
sysctl.his 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
Signature · 7 lines
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 [email protected] Please read the FAQ at http://www.tux.org/lkml/