[RFC PATCH 1/2] Remove highmem.h include from pagemap.h

Previous thread: [RFC PATCH 0/2] Fix linux/swap.h build wart by Jeff Dike on Friday, October 26, 2007 - 3:25 pm. (3 messages)

Next thread: Adding TIF_TRACE_KERNEL to x86_64 by Mathieu Desnoyers on Friday, October 26, 2007 - 3:37 pm. (7 messages)
To: LKML <linux-kernel@...>, <linux-fsdevel@...>, <linux-arch@...>
Date: Friday, October 26, 2007 - 3:25 pm

There has been a long-standing wart in linux/swap.h where it uses
page_cache_release and release_pages without declaring them by
including linux/pagemap.h. There is this scary comment to warn off
anyone foolish enough to try to fix this:

/* only sparc can not include linux/pagemap.h in this file
* so leave page_cache_release and release_pages undeclared... */

This has caused problems for a number of people including:
akpm - http://www.ussg.iu.edu/hypermail/linux/kernel/0708.3/0446.html
"Oh that damn thing again. It's a regular source of
include breakage."
ppc - http://patchwork.ozlabs.org/linuxppc/patch?id=12288
UML - http://www.mail-archive.com/user-mode-linux-devel@lists.sourceforge.net/...

What happens with sparc, when this include is added, is a linux/mm.h ->
linux/mm.h recursion:
linux/mm.h -> asm/pgtable.h -> linux/swap.h -> linux/pagemap.h ->
linux/highmem.h -> linux/mm.h
leaving various things that live in mm.h undefined in highmem.h.

sparc is unique in the asm/pgtable.h -> linux/swap.h inclusion. This
looks correct, as pgtable.h uses swp_entry_t, which is defined in
swap.h, so maybe the other arches should do the same. Adding this to
the UML pgtable.h causes the same build breakage.

All of the links in the recursion above look reasonable, except for
linux/pagemap.h -> linux/highmem.h, which is the point of attack for
this fix.

linux/pagemap.h uses nothing from linux/highmem.h, so doesn't need to
include it. However, there are a number of files which use stuff from
highmem.h, don't include it, but do include pagemap.h. This patch
removes the linux/pagemap.h -> linux/highmem.h inclusion and adds a
linux/highmem.h include to every file in the tree which now needs one.

---
arch/parisc/kernel/cache.c | 1 +
drivers/block/rd.c | 1 +
drivers/dma/iovlock.c | 1 +
drivers/media/video/ivtv/ivtv-udma.c | 1 +
drivers/net/e...

Previous thread: [RFC PATCH 0/2] Fix linux/swap.h build wart by Jeff Dike on Friday, October 26, 2007 - 3:25 pm. (3 messages)

Next thread: Adding TIF_TRACE_KERNEL to x86_64 by Mathieu Desnoyers on Friday, October 26, 2007 - 3:37 pm. (7 messages)