提交 d9674dda 编写于 作者: S Sasha Levin 提交者: Konrad Rzeszutek Wilk

mm: frontswap: make all branches of if statement in put page consistent

Currently it has a complex structure where different things are compared
at each branch. Simplify that and make both branches look similar.
Reviewed-by: NMinchan Kim <minchan@kernel.org>
Signed-off-by: NSasha Levin <levinsasha928@gmail.com>
Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
上级 69217b4c
......@@ -140,16 +140,16 @@ int __frontswap_store(struct page *page)
inc_frontswap_succ_stores();
if (!dup)
atomic_inc(&sis->frontswap_pages);
} else if (dup) {
} else {
/*
failed dup always results in automatic invalidate of
the (older) page from frontswap
*/
frontswap_clear(sis, offset);
atomic_dec(&sis->frontswap_pages);
inc_frontswap_failed_stores();
} else {
inc_frontswap_failed_stores();
if (dup) {
frontswap_clear(sis, offset);
atomic_dec(&sis->frontswap_pages);
}
}
if (frontswap_writethrough_enabled)
/* report failure so swap also writes to swap device */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册