提交 1ccdc3b1 编写于 作者: M Miaohe Lin 提交者: Zheng Zengkai

mm/swap: remove unused local variable nr_shadows

mainline inclusion
from mainline-v5.14-rc1
commit eb7709c5
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I3ZE5V
CVE: NA

-------------------------------------------------

Since commit 55c653b71e8c ("mm: stop accounting shadow entries"),
nr_shadows is not used anymore.

Link: https://lkml.kernel.org/r/20210520134022.1370406-3-linmiaohe@huawei.comSigned-off-by: NMiaohe Lin <linmiaohe@huawei.com>
Reviewed-by: NMatthew Wilcox (Oracle) <willy@infradead.org>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: NLiu Shixin <liushixin2@huawei.com>
Reviewed-by: NTong Tiangen <tongtiangen@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 f54e280e
...@@ -140,8 +140,6 @@ int add_to_swap_cache(struct page *page, swp_entry_t entry, ...@@ -140,8 +140,6 @@ int add_to_swap_cache(struct page *page, swp_entry_t entry,
SetPageSwapCache(page); SetPageSwapCache(page);
do { do {
unsigned long nr_shadows = 0;
xas_lock_irq(&xas); xas_lock_irq(&xas);
xas_create_range(&xas); xas_create_range(&xas);
if (xas_error(&xas)) if (xas_error(&xas))
...@@ -150,7 +148,6 @@ int add_to_swap_cache(struct page *page, swp_entry_t entry, ...@@ -150,7 +148,6 @@ int add_to_swap_cache(struct page *page, swp_entry_t entry,
VM_BUG_ON_PAGE(xas.xa_index != idx + i, page); VM_BUG_ON_PAGE(xas.xa_index != idx + i, page);
old = xas_load(&xas); old = xas_load(&xas);
if (xa_is_value(old)) { if (xa_is_value(old)) {
nr_shadows++;
if (shadowp) if (shadowp)
*shadowp = old; *shadowp = old;
} }
...@@ -284,7 +281,6 @@ void clear_shadow_from_swap_cache(int type, unsigned long begin, ...@@ -284,7 +281,6 @@ void clear_shadow_from_swap_cache(int type, unsigned long begin,
void *old; void *old;
for (;;) { for (;;) {
unsigned long nr_shadows = 0;
swp_entry_t entry = swp_entry(type, curr); swp_entry_t entry = swp_entry(type, curr);
struct address_space *address_space = swap_address_space(entry); struct address_space *address_space = swap_address_space(entry);
XA_STATE(xas, &address_space->i_pages, curr); XA_STATE(xas, &address_space->i_pages, curr);
...@@ -294,7 +290,6 @@ void clear_shadow_from_swap_cache(int type, unsigned long begin, ...@@ -294,7 +290,6 @@ void clear_shadow_from_swap_cache(int type, unsigned long begin,
if (!xa_is_value(old)) if (!xa_is_value(old))
continue; continue;
xas_store(&xas, NULL); xas_store(&xas, NULL);
nr_shadows++;
} }
xa_unlock_irq(&address_space->i_pages); xa_unlock_irq(&address_space->i_pages);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册