]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm/swap: remove unused global variable nr_swapper_spaces
authorMiaohe Lin <linmiaohe@huawei.com>
Wed, 2 Jun 2021 03:52:11 +0000 (13:52 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 2 Jun 2021 03:52:11 +0000 (13:52 +1000)
Since commit b6038942480e ("mm: memcg: add swapcache stat for memcg v2"),
the last user of nr_swapper_spaces is gone.  So we remove this unused one.

Link: https://lkml.kernel.org/r/20210520134022.1370406-5-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
mm/swap_state.c

index 1a2ba4056f3760bd41805a37ff9f215b8e078220..b5a3dc8f47a10abfe7b859391f59495d0168b9f0 100644 (file)
@@ -37,7 +37,6 @@ static const struct address_space_operations swap_aops = {
 };
 
 struct address_space *swapper_spaces[MAX_SWAPFILES] __read_mostly;
-static unsigned int nr_swapper_spaces[MAX_SWAPFILES] __read_mostly;
 static bool enable_vma_readahead __read_mostly = true;
 
 #define SWAP_RA_WIN_SHIFT      (PAGE_SHIFT / 2)
@@ -685,7 +684,6 @@ int init_swap_address_space(unsigned int type, unsigned long nr_pages)
                /* swap cache doesn't use writeback related tags */
                mapping_set_no_writeback_tags(space);
        }
-       nr_swapper_spaces[type] = nr;
        swapper_spaces[type] = spaces;
 
        return 0;
@@ -694,7 +692,6 @@ int init_swap_address_space(unsigned int type, unsigned long nr_pages)
 void exit_swap_address_space(unsigned int type)
 {
        kvfree(swapper_spaces[type]);
-       nr_swapper_spaces[type] = 0;
        swapper_spaces[type] = NULL;
 }