This change is being made so that zswap_store can process mTHP folios. Modified zswap_is_folio_same_filled() to work for any-order folios, by accepting an additional "index" parameter to arrive at the page within the folio to run the same-filled page check. Signed-off-by: Kanchana P Sridhar <kanchana.p.sridhar@xxxxxxxxx> --- mm/zswap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/zswap.c b/mm/zswap.c index df66ab102d27..6434e76a4ea3 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -1419,14 +1419,14 @@ static void shrink_worker(struct work_struct *w) /********************************* * same-filled functions **********************************/ -static bool zswap_is_folio_same_filled(struct folio *folio, unsigned long *value) +static bool zswap_is_folio_same_filled(struct folio *folio, long index, unsigned long *value) { unsigned long *data; unsigned long val; unsigned int pos, last_pos = PAGE_SIZE / sizeof(*data) - 1; bool ret = false; - data = kmap_local_folio(folio, 0); + data = kmap_local_folio(folio, index * PAGE_SIZE); val = data[0]; if (val != data[last_pos]) @@ -1496,7 +1496,7 @@ bool zswap_store(struct folio *folio) goto reject; } - if (zswap_is_folio_same_filled(folio, &value)) { + if (zswap_is_folio_same_filled(folio, 0, &value)) { entry->length = 0; entry->value = value; atomic_inc(&zswap_same_filled_pages); -- 2.27.0