Thread (23 messages) flat view 23 messages, 4 authors, 4d ago

Re: [PATCH v2 4/8] mm/zswap: use folio_swap_entry() in zswap_store_page()

From: "David Hildenbrand (Arm)" <david@kernel.org>
Date: 2026-09-09 14:01:10
Also in: linux-mm, lkml

On 9/8/26 17:16, Tal Zussman wrote:
quoted hunk ↗ jump to hunk
zswap_store_page() open-codes the swap entry computation from
folio->swap and the page index. Use folio_swap_entry() instead.

No functional change.

Signed-off-by: Tal Zussman <redacted>
---
 mm/zswap.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/mm/zswap.c b/mm/zswap.c
index 5d0d8bd72193..c27e22d067e3 100644
--- a/mm/zswap.c
+++ b/mm/zswap.c
@@ -1398,8 +1398,7 @@ static bool zswap_store_page(struct folio *folio, long index,
 			     struct obj_cgroup *objcg,
 			     struct zswap_pool *pool)
 {
-	swp_entry_t page_swpentry = swp_entry(swp_type(folio->swap),
-					      swp_offset(folio->swap) + index);
+	swp_entry_t page_swpentry = folio_swap_entry(folio, index);
 	struct zswap_entry *entry, *old;
 
 	/* allocate entry */
Acked-by: David Hildenbrand (Arm) <david@kernel.org>

-- 
Cheers,

David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help