* [PATCH] [1/6] Reduce user-visible noise in <linux/nfs_fs.h>
2006-09-09 11:18 [0/6] 'make headers_check' fixes for 2.6.18 David Woodhouse
@ 2006-09-09 11:21 ` David Woodhouse
2006-09-09 11:24 ` [PATCH] [2/6] Remove <asm/timex.h> from user export David Woodhouse
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: David Woodhouse @ 2006-09-09 11:21 UTC (permalink / raw)
To: torvalds; +Cc: akpm, linux-kernel, neilb
We don't need any of this crap included from the user-visible part of
nfs_fs.h -- remove it all.
In fact, we probably don't need anything but NFS_SUPER_MAGIC to be
defined; is there any need for anything else? And magic numbers should
probably move to <linux/magic.h> rather than being strewn across various
fs-specific include files which exist in userspace for solely that
purpose.
With this patch, 'make header_check' works again at least on PowerPC.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 530b1e6..6c2066c 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -9,27 +9,6 @@
#ifndef _LINUX_NFS_FS_H
#define _LINUX_NFS_FS_H
-#include <linux/in.h>
-#include <linux/mm.h>
-#include <linux/pagemap.h>
-#include <linux/rwsem.h>
-#include <linux/wait.h>
-
-#include <linux/sunrpc/debug.h>
-#include <linux/sunrpc/auth.h>
-#include <linux/sunrpc/clnt.h>
-
-#include <linux/nfs.h>
-#include <linux/nfs2.h>
-#include <linux/nfs3.h>
-#include <linux/nfs4.h>
-#include <linux/nfs_xdr.h>
-
-#include <linux/nfs_fs_sb.h>
-
-#include <linux/rwsem.h>
-#include <linux/mempool.h>
-
/*
* Enable debugging support for nfs client.
* Requires RPC_DEBUG.
@@ -48,11 +27,6 @@ #define NFS_MAX_TCP_TIMEOUT (600*HZ)
#define NFS_SUPER_MAGIC 0x6969
/*
- * These are the default flags for swap requests
- */
-#define NFS_RPC_SWAPFLAGS (RPC_TASK_SWAPPER|RPC_TASK_ROOTCREDS)
-
-/*
* When flushing a cluster of dirty pages, there can be different
* strategies:
*/
@@ -65,6 +39,32 @@ #define FLUSH_INVALIDATE 64 /* Invalidat
#ifdef __KERNEL__
+#include <linux/in.h>
+#include <linux/mm.h>
+#include <linux/pagemap.h>
+#include <linux/rwsem.h>
+#include <linux/wait.h>
+
+#include <linux/sunrpc/debug.h>
+#include <linux/sunrpc/auth.h>
+#include <linux/sunrpc/clnt.h>
+
+#include <linux/nfs.h>
+#include <linux/nfs2.h>
+#include <linux/nfs3.h>
+#include <linux/nfs4.h>
+#include <linux/nfs_xdr.h>
+
+#include <linux/nfs_fs_sb.h>
+
+#include <linux/rwsem.h>
+#include <linux/mempool.h>
+
+/*
+ * These are the default flags for swap requests
+ */
+#define NFS_RPC_SWAPFLAGS (RPC_TASK_SWAPPER|RPC_TASK_ROOTCREDS)
+
/*
* NFSv3/v4 Access mode cache entry
*/
--
dwmw2
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH] [2/6] Remove <asm/timex.h> from user export
2006-09-09 11:18 [0/6] 'make headers_check' fixes for 2.6.18 David Woodhouse
2006-09-09 11:21 ` [PATCH] [1/6] Reduce user-visible noise in <linux/nfs_fs.h> David Woodhouse
@ 2006-09-09 11:24 ` David Woodhouse
2006-09-09 11:27 ` [PATCH] [3/6] Move inclusion of <linux/linkage.h> in <asm-i386/signal.h> David Woodhouse
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: David Woodhouse @ 2006-09-09 11:24 UTC (permalink / raw)
To: torvalds; +Cc: akpm, linux-kernel
There's useful stuff in <linux/timex.h> but <asm/timex.h> has nothing
for userspace. Stop exporting it, and include it only from within the
existing #ifdef __KERNEL__ part of <linux/timex.h>
This fixes a 'make headers_check' failure on i386 because
asm-i386/timex.h includes both asm-i386/tsc.h and asm-i386/processor.h,
neither of which are exported to userspace. It's not entirely clear
_why_ it includes either of these, but it does.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
diff --git a/include/asm-generic/Kbuild.asm b/include/asm-generic/Kbuild.asm
index 6b16dda..c00de60 100644
--- a/include/asm-generic/Kbuild.asm
+++ b/include/asm-generic/Kbuild.asm
@@ -2,7 +2,7 @@ unifdef-y += a.out.h auxvec.h byteorder.
ioctls.h ipcbuf.h mman.h msgbuf.h param.h poll.h \
posix_types.h ptrace.h resource.h sembuf.h shmbuf.h shmparam.h \
sigcontext.h siginfo.h signal.h socket.h sockios.h stat.h \
- statfs.h termbits.h termios.h timex.h types.h unistd.h user.h
+ statfs.h termbits.h termios.h types.h unistd.h user.h
# These probably shouldn't be exported
unifdef-y += elf.h page.h
diff --git a/include/linux/timex.h b/include/linux/timex.h
index 19bb653..d543d38 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -57,7 +57,6 @@ #include <linux/compiler.h>
#include <linux/time.h>
#include <asm/param.h>
-#include <asm/timex.h>
/*
* SHIFT_KG and SHIFT_KF establish the damping of the PLL and are chosen
@@ -191,6 +190,8 @@ #define TIME_ERROR 5 /* clock not synchr
#define TIME_BAD TIME_ERROR /* bw compat */
#ifdef __KERNEL__
+#include <asm/timex.h>
+
/*
* kernel variables
* Note: maximum error = NTP synch distance = dispersion + delay / 2;
--
dwmw2
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH] [3/6] Move inclusion of <linux/linkage.h> in <asm-i386/signal.h>
2006-09-09 11:18 [0/6] 'make headers_check' fixes for 2.6.18 David Woodhouse
2006-09-09 11:21 ` [PATCH] [1/6] Reduce user-visible noise in <linux/nfs_fs.h> David Woodhouse
2006-09-09 11:24 ` [PATCH] [2/6] Remove <asm/timex.h> from user export David Woodhouse
@ 2006-09-09 11:27 ` David Woodhouse
2006-09-09 11:29 ` [PATCH] [4/6] Move kernel-only #includes within <asm-i386/elf.h> David Woodhouse
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: David Woodhouse @ 2006-09-09 11:27 UTC (permalink / raw)
To: torvalds; +Cc: akpm, linux-kernel
Because <linux/linkage.h> doesn't exist in userspace, it should be only
included from within #ifdef __KERNEL__. Move the corresponding #include
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
diff --git a/include/asm-i386/signal.h b/include/asm-i386/signal.h
index 3824a50..c3e8ade 100644
--- a/include/asm-i386/signal.h
+++ b/include/asm-i386/signal.h
@@ -2,7 +2,6 @@ #ifndef _ASMi386_SIGNAL_H
#define _ASMi386_SIGNAL_H
#include <linux/types.h>
-#include <linux/linkage.h>
#include <linux/time.h>
#include <linux/compiler.h>
@@ -10,6 +9,9 @@ #include <linux/compiler.h>
struct siginfo;
#ifdef __KERNEL__
+
+#include <linux/linkage.h>
+
/* Most things should be clean enough to redefine this at will, if care
is taken to make libc match. */
--
dwmw2
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH] [4/6] Move kernel-only #includes within <asm-i386/elf.h>
2006-09-09 11:18 [0/6] 'make headers_check' fixes for 2.6.18 David Woodhouse
` (2 preceding siblings ...)
2006-09-09 11:27 ` [PATCH] [3/6] Move inclusion of <linux/linkage.h> in <asm-i386/signal.h> David Woodhouse
@ 2006-09-09 11:29 ` David Woodhouse
2006-09-09 11:31 ` [PATCH] [5/6] Don't expose PFN stuff to userspace in <asm-i386/setup.h> David Woodhouse
2006-09-09 11:36 ` [PATCH] [6/6] Fix userspace build of asm-mips/page.h David Woodhouse
5 siblings, 0 replies; 7+ messages in thread
From: David Woodhouse @ 2006-09-09 11:29 UTC (permalink / raw)
To: torvalds; +Cc: akpm, linux-kernel
Some files which don't exist in userspace were being included
unconditionally in asm-i386/elf.h. Move the offending #includes down a
few lines so that they're protected by #ifdef __KERNEL__
In fact, we probably want to kill off all userspace use of asm/elf.h --
but we aren't there yet, so we should at least make it possible to
include it for now.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
diff --git a/include/asm-i386/elf.h b/include/asm-i386/elf.h
index 1eac92c..db4344d 100644
--- a/include/asm-i386/elf.h
+++ b/include/asm-i386/elf.h
@@ -7,10 +7,7 @@ #define __ASMi386_ELF_H
#include <asm/ptrace.h>
#include <asm/user.h>
-#include <asm/processor.h>
-#include <asm/system.h> /* for savesegment */
#include <asm/auxvec.h>
-#include <asm/desc.h>
#include <linux/utsname.h>
@@ -48,6 +45,12 @@ #define ELF_CLASS ELFCLASS32
#define ELF_DATA ELFDATA2LSB
#define ELF_ARCH EM_386
+#ifdef __KERNEL__
+
+#include <asm/processor.h>
+#include <asm/system.h> /* for savesegment */
+#include <asm/desc.h>
+
/* SVR4/i386 ABI (pages 3-31, 3-32) says that when the program starts %edx
contains a pointer to a function which might be registered using `atexit'.
This provides a mean for the dynamic linker to call DT_FINI functions for
@@ -111,7 +114,6 @@ #define ELF_HWCAP (boot_cpu_data.x86_cap
#define ELF_PLATFORM (system_utsname.machine)
-#ifdef __KERNEL__
#define SET_PERSONALITY(ex, ibcs2) do { } while (0)
/*
--
dwmw2
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH] [5/6] Don't expose PFN stuff to userspace in <asm-i386/setup.h>
2006-09-09 11:18 [0/6] 'make headers_check' fixes for 2.6.18 David Woodhouse
` (3 preceding siblings ...)
2006-09-09 11:29 ` [PATCH] [4/6] Move kernel-only #includes within <asm-i386/elf.h> David Woodhouse
@ 2006-09-09 11:31 ` David Woodhouse
2006-09-09 11:36 ` [PATCH] [6/6] Fix userspace build of asm-mips/page.h David Woodhouse
5 siblings, 0 replies; 7+ messages in thread
From: David Woodhouse @ 2006-09-09 11:31 UTC (permalink / raw)
To: torvalds; +Cc: akpm, linux-kernel
The header file <linux/pfn.h> doesn't exist in userspace and probably
shouldn't -- but it's used unconditionally in <asm-i386/setup.h>.
Protect it with #ifdef __KERNEL__ and move setup.h from $(header-y) to
$(unifdef-y) in Kbuild accordingly.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
diff --git a/include/asm-i386/Kbuild b/include/asm-i386/Kbuild
index 335b2fa..2308190 100644
--- a/include/asm-i386/Kbuild
+++ b/include/asm-i386/Kbuild
@@ -1,5 +1,5 @@
include include/asm-generic/Kbuild.asm
-header-y += boot.h debugreg.h ldt.h setup.h ucontext.h
+header-y += boot.h debugreg.h ldt.h ucontext.h
-unifdef-y += mtrr.h vm86.h
+unifdef-y += mtrr.h setup.h vm86.h
diff --git a/include/asm-i386/setup.h b/include/asm-i386/setup.h
index f737e42..2734909 100644
--- a/include/asm-i386/setup.h
+++ b/include/asm-i386/setup.h
@@ -6,6 +6,7 @@
#ifndef _i386_SETUP_H
#define _i386_SETUP_H
+#ifdef __KERNEL__
#include <linux/pfn.h>
/*
@@ -13,6 +14,7 @@ #include <linux/pfn.h>
*/
#define MAXMEM_PFN PFN_DOWN(MAXMEM)
#define MAX_NONPAE_PFN (1 << 20)
+#endif
#define PARAM_SIZE 4096
#define COMMAND_LINE_SIZE 256
--
dwmw2
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH] [6/6] Fix userspace build of asm-mips/page.h
2006-09-09 11:18 [0/6] 'make headers_check' fixes for 2.6.18 David Woodhouse
` (4 preceding siblings ...)
2006-09-09 11:31 ` [PATCH] [5/6] Don't expose PFN stuff to userspace in <asm-i386/setup.h> David Woodhouse
@ 2006-09-09 11:36 ` David Woodhouse
5 siblings, 0 replies; 7+ messages in thread
From: David Woodhouse @ 2006-09-09 11:36 UTC (permalink / raw)
To: torvalds; +Cc: akpm, linux-kernel, ralf
MIPS asm/page.h unconditionally includes <asm-generic/memory_model.h>,
which doesn't exist in userspace. Move an #endif /* __KERNEL__ */ down a
few lines to prevent that.
Also, remove the broken definition of PAGE_SIZE which is never going to
be correct -- in the absence of PAGE_SIZE, non-broken userspace will
fall back to using sysconf() or getpagesize() instead.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
index 6ed1151..219d359 100644
--- a/include/asm-mips/page.h
+++ b/include/asm-mips/page.h
@@ -14,8 +14,6 @@ #ifdef __KERNEL__
#include <spaces.h>
-#endif
-
/*
* PAGE_SHIFT determines the page size
*/
@@ -34,8 +32,6 @@ #endif
#define PAGE_SIZE (1UL << PAGE_SHIFT)
#define PAGE_MASK (~((1 << PAGE_SHIFT) - 1))
-
-#ifdef __KERNEL__
#ifndef __ASSEMBLY__
extern void clear_page(void * page);
@@ -168,8 +164,6 @@ #define VM_DATA_DEFAULT_FLAGS (VM_READ |
#define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + UNCAC_BASE)
#define CAC_ADDR(addr) ((addr) - UNCAC_BASE + PAGE_OFFSET)
-#endif /* defined (__KERNEL__) */
-
#ifdef CONFIG_LIMITED_DMA
#define WANT_PAGE_VIRTUAL
#endif
@@ -177,4 +171,6 @@ #endif
#include <asm-generic/memory_model.h>
#include <asm-generic/page.h>
+#endif /* defined (__KERNEL__) */
+
#endif /* _ASM_PAGE_H */
--
dwmw2
^ permalink raw reply [flat|nested] 7+ messages in thread