]> git.baikalelectronics.ru Git - kernel.git/commit
mm/swap_state.c: use the same way to count page in [add_to|delete_from]_swap_cache
authorWei Yang <richard.weiyang@gmail.com>
Thu, 2 Apr 2020 04:06:26 +0000 (21:06 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 2 Apr 2020 16:35:28 +0000 (09:35 -0700)
commit85bdd1d735a36b40941b4a4b2c7a88b167acea82
treef313bfcec28300512ec35755a9b158e6309853b9
parentc39958c61350658304a72e5b7869084ba8c5b7ee
mm/swap_state.c: use the same way to count page in [add_to|delete_from]_swap_cache

add_to_swap_cache() and delete_from_swap_cache() are counterparts, while
currently they use different ways to count pages.

It doesn't break anything because we only have two sizes for PageAnon, but
this is confusing and not good practice.

This patch corrects it by making both functions use hpage_nr_pages().

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Link: http://lkml.kernel.org/r/20200315012920.2687-1-richard.weiyang@gmail.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/swap_state.c