This is a 1:1 conversion. The major part of this patch is converting the test framework from userspace to kernel space and mirroring the algorithm now used in find_swap_entry(). Change-Id: I06fdac38fbbf5e446f9b900cc86c4bdfa1d16d5a Signed-off-by: Matthew Wilcox <willy@infradead.org>