]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] fix can_share_swap_page() when !CONFIG_SWAP
authorHua Zhong <hzhong@gmail.com>
Mon, 15 May 2006 16:44:22 +0000 (09:44 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 15 May 2006 18:20:56 +0000 (11:20 -0700)
commit868d46531a4d97cf1cba97765db0264572709f8e
treedf1aeae28ce51103a0c9eda8f7d40e463297b2ef
parent01ddc8b4fa3d10312a3ada448517b73d7ab13a1f
[PATCH] fix can_share_swap_page() when !CONFIG_SWAP

can_share_swap_page() is used to check if the page has the last reference.
This avoids allocating a new page for COW if it's the last page.

However, if CONFIG_SWAP is not set, can_share_swap_page() is defined as 0,
thus always causes a copy for the last COW page.  The below simple patch
fixes it.

Signed-off-by: Hua Zhong <hzhong@gmail.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/linux/swap.h