In preparation for later changes, refactor out a new function called
try_to_merge_with_zero_page(), which tries to merge with zero page.
Signed-off-by: Chengming Zhou <chengming.zhou@xxxxxxxxx>
---
mm/ksm.c | 67 +++++++++++++++++++++++++++++++++++-----------------------------
1 file changed, 37 insertions(+), 30 deletions(-)
diff --git a/mm/ksm.c b/mm/ksm.c
index 4dc707d175fa..cbd4ba7ea974 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -1531,6 +1531,41 @@ static int try_to_merge_one_page(struct vm_area_struct *vma,
return err;
}
+/* This function returns 0 if the pages were merged, -EFAULT otherwise. */