From: Adrian Bunk This patch makes the following needlessly global code static: - swap_lock - nr_swapfiles - struct swap_list Signed-off-by: Adrian Bunk Reviewed-by: KOSAKI Motohiro Signed-off-by: Andrew Morton --- include/linux/swap.h | 3 --- mm/swapfile.c | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff -puN include/linux/swap.h~mm-swapfilec-make-code-static include/linux/swap.h --- a/include/linux/swap.h~mm-swapfilec-make-code-static +++ a/include/linux/swap.h @@ -237,7 +237,6 @@ extern struct page *swapin_readahead(swp /* linux/mm/swapfile.c */ extern long total_swap_pages; -extern unsigned int nr_swapfiles; extern void si_swapinfo(struct sysinfo *); extern swp_entry_t get_swap_page(void); extern swp_entry_t get_swap_page_of_type(int); @@ -254,8 +253,6 @@ extern int can_share_swap_page(struct pa extern int remove_exclusive_swap_page(struct page *); struct backing_dev_info; -extern spinlock_t swap_lock; - /* linux/mm/thrash.c */ extern struct mm_struct * swap_token_mm; extern void grab_swap_token(void); diff -puN mm/swapfile.c~mm-swapfilec-make-code-static mm/swapfile.c --- a/mm/swapfile.c~mm-swapfilec-make-code-static +++ a/mm/swapfile.c @@ -33,8 +33,8 @@ #include #include -DEFINE_SPINLOCK(swap_lock); -unsigned int nr_swapfiles; +static DEFINE_SPINLOCK(swap_lock); +static unsigned int nr_swapfiles; long total_swap_pages; static int swap_overflow; @@ -43,7 +43,7 @@ static const char Unused_file[] = "Unuse static const char Bad_offset[] = "Bad swap offset entry "; static const char Unused_offset[] = "Unused swap offset entry "; -struct swap_list_t swap_list = {-1, -1}; +static struct swap_list_t swap_list = {-1, -1}; static struct swap_info_struct swap_info[MAX_SWAPFILES]; _