Commit 8e7a0c91 authored by Randy Dunlap's avatar Randy Dunlap Committed by Linus Torvalds

mm/swap_slots.c: use conditional compilation

For mm/swap_slots.c, use the traditional Linux method of conditional
compilation and linking instead of always compiling it by using #ifdef
CONFIG_SWAP and #endif for the entire source file (excluding header
files).

Link: http://lkml.kernel.org/r/c2a47015-0b5a-d0d9-8bc7-9984c049df20@infradead.orgSigned-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Acked-by: default avatarTim Chen <tim.c.chen@linux.intel.com>
Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 31025351
...@@ -37,7 +37,7 @@ obj-y := filemap.o mempool.o oom_kill.o \ ...@@ -37,7 +37,7 @@ obj-y := filemap.o mempool.o oom_kill.o \
readahead.o swap.o truncate.o vmscan.o shmem.o \ readahead.o swap.o truncate.o vmscan.o shmem.o \
util.o mmzone.o vmstat.o backing-dev.o \ util.o mmzone.o vmstat.o backing-dev.o \
mm_init.o mmu_context.o percpu.o slab_common.o \ mm_init.o mmu_context.o percpu.o slab_common.o \
compaction.o vmacache.o swap_slots.o \ compaction.o vmacache.o \
interval_tree.o list_lru.o workingset.o \ interval_tree.o list_lru.o workingset.o \
debug.o $(mmu-y) debug.o $(mmu-y)
...@@ -55,7 +55,7 @@ ifdef CONFIG_MMU ...@@ -55,7 +55,7 @@ ifdef CONFIG_MMU
endif endif
obj-$(CONFIG_HAVE_MEMBLOCK) += memblock.o obj-$(CONFIG_HAVE_MEMBLOCK) += memblock.o
obj-$(CONFIG_SWAP) += page_io.o swap_state.o swapfile.o obj-$(CONFIG_SWAP) += page_io.o swap_state.o swapfile.o swap_slots.o
obj-$(CONFIG_FRONTSWAP) += frontswap.o obj-$(CONFIG_FRONTSWAP) += frontswap.o
obj-$(CONFIG_ZSWAP) += zswap.o obj-$(CONFIG_ZSWAP) += zswap.o
obj-$(CONFIG_HAS_DMA) += dmapool.o obj-$(CONFIG_HAS_DMA) += dmapool.o
......
...@@ -34,8 +34,6 @@ ...@@ -34,8 +34,6 @@
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/mm.h> #include <linux/mm.h>
#ifdef CONFIG_SWAP
static DEFINE_PER_CPU(struct swap_slots_cache, swp_slots); static DEFINE_PER_CPU(struct swap_slots_cache, swp_slots);
static bool swap_slot_cache_active; static bool swap_slot_cache_active;
bool swap_slot_cache_enabled; bool swap_slot_cache_enabled;
...@@ -356,5 +354,3 @@ swp_entry_t get_swap_page(struct page *page) ...@@ -356,5 +354,3 @@ swp_entry_t get_swap_page(struct page *page)
return entry; return entry;
} }
#endif /* CONFIG_SWAP */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment