Skip to contentSkip to conversation

don't include swap.h in mm.h

PATCH New Christoph Hellwig 1 participant 1 message Mar 23, 2003

Subsystems (8)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 don't include swap.h in mm.h

swap.h is basically the header for MM internals instead of the public API (mm_internal.h would have been a better name..). Stop including it in mm.h - this only needs moving one function that should be in swap.h anyway to the right place and fixing up a bunch of places using it.

drivers/block/ll_rw_blk.c +1 -0
@@ -26,6 +26,7 @@
 #include <linux/bootmem.h>	/* for max_pfn/max_low_pfn */
 #include <linux/completion.h>
 #include <linux/slab.h>
+#include <linux/swap.h>
 
 static void blk_unplug_work(void *data);
 static void blk_unplug_timeout(unsigned long data);
fs/bio.c +1 -1
@@ -7,7 +7,6 @@
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
-
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
@@ -17,6 +16,7 @@
  *
  */
 #include <linux/mm.h>
+#include <linux/swap.h>
 #include <linux/bio.h>
 #include <linux/blk.h>
 #include <linux/slab.h>
include/linux/mm.h +1 -5
@@ -8,10 +8,8 @@
 
 #include <linux/config.h>
 #include <linux/gfp.h>
-#include <linux/string.h>
 #include <linux/list.h>
 #include <linux/mmzone.h>
-#include <linux/swap.h>
 #include <linux/rbtree.h>
 #include <linux/fs.h>
 
@@ -142,6 +140,7 @@
 /* forward declaration; pte_chain is meant to be internal to rmap.c */
 struct pte_chain;
 struct mmu_gather;
+struct inode;
 
 /*
  * Each physical page in the system has a struct page associated with
@@ -490,10 +489,7 @@
 extern void mem_init(void);
 extern void show_mem(void);
 extern void si_meminfo(struct sysinfo * val);
-#ifdef CONFIG_NUMA
 extern void si_meminfo_node(struct sysinfo *val, int nid);
-#endif
-extern void swapin_readahead(swp_entry_t);
 
 /* mmap.c */
 extern void insert_vm_struct(struct mm_struct *, struct vm_area_struct *);
include/linux/swap.h +3 -0
@@ -144,6 +144,9 @@
 /* linux/mm/oom_kill.c */
 extern void out_of_memory(void);
 
+/* linux/mm/memory.c */
+extern void swapin_readahead(swp_entry_t);
+
 /* linux/mm/page_alloc.c */
 extern unsigned long totalram_pages;
 extern unsigned long totalhigh_pages;
kernel/sysctl.c +1 -0
@@ -20,6 +20,7 @@
 
 #include <linux/config.h>
 #include <linux/mm.h>
+#include <linux/swap.h>
 #include <linux/slab.h>
 #include <linux/sysctl.h>
 #include <linux/proc_fs.h>
kernel/timer.c +1 -0
@@ -24,6 +24,7 @@
 #include <linux/percpu.h>
 #include <linux/init.h>
 #include <linux/mm.h>
+#include <linux/swap.h>
 #include <linux/notifier.h>
 #include <linux/thread_info.h>
 #include <linux/time.h>
mm/filemap.c +1 -0
@@ -17,6 +17,7 @@
 #include <linux/aio.h>
 #include <linux/kernel_stat.h>
 #include <linux/mm.h>
+#include <linux/swap.h>
 #include <linux/mman.h>
 #include <linux/pagemap.h>
 #include <linux/file.h>
mm/fremap.c +1 -0
@@ -7,6 +7,7 @@
  */
 
 #include <linux/mm.h>
+#include <linux/swap.h>
 #include <linux/file.h>
 #include <linux/mman.h>
 #include <linux/pagemap.h>
mm/highmem.c +1 -0
@@ -17,6 +17,7 @@
  */
 
 #include <linux/mm.h>
+#include <linux/swap.h>
 #include <linux/bio.h>
 #include <linux/pagemap.h>
 #include <linux/mempool.h>
mm/page-writeback.c +1 -0
@@ -15,6 +15,7 @@
 #include <linux/spinlock.h>
 #include <linux/fs.h>
 #include <linux/mm.h>
+#include <linux/swap.h>
 #include <linux/slab.h>
 #include <linux/pagemap.h>
 #include <linux/writeback.h>
mm/rmap.c +1 -0
@@ -22,6 +22,7 @@
  */
 #include <linux/mm.h>
 #include <linux/pagemap.h>
+#include <linux/swap.h>
 #include <linux/swapops.h>
 #include <linux/slab.h>
 #include <linux/init.h>