Skip to content

Commit

Permalink
mm/swapfile.c: make code static
Browse files Browse the repository at this point in the history
This patch makes the following needlessly global code static:
 - swap_lock
 - nr_swapfiles
 - struct swap_list

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Adrian Bunk authored and Linus Torvalds committed Jul 26, 2008
1 parent 15f59ad commit 7c363b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 0 additions & 3 deletions include/linux/swap.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ extern struct page *swapin_readahead(swp_entry_t, gfp_t,

/* 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);
Expand All @@ -254,8 +253,6 @@ extern int can_share_swap_page(struct page *);
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);
Expand Down
6 changes: 3 additions & 3 deletions mm/swapfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
#include <asm/tlbflush.h>
#include <linux/swapops.h>

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;
static int least_priority;
Expand All @@ -44,7 +44,7 @@ static const char Unused_file[] = "Unused swap file entry ";
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];

Expand Down

0 comments on commit 7c363b8

Please sign in to comment.