diff mbox series

[2/3] mm :zswap: use kmap_local_folio() in zswap_load()

Message ID 20240524033819.1953587-3-yosryahmed@google.com (mailing list archive)
State New
Headers show
Series mm: zswap: trivial folio conversions | expand

Commit Message

Yosry Ahmed May 24, 2024, 3:38 a.m. UTC
Eliminate the last explicit 'struct page' reference in mm/zswap.c.

Signed-off-by: Yosry Ahmed <yosryahmed@google.com>
---
 mm/zswap.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Nhat Pham May 28, 2024, 3:16 p.m. UTC | #1
On Thu, May 23, 2024 at 8:38 PM Yosry Ahmed <yosryahmed@google.com> wrote:
>
> Eliminate the last explicit 'struct page' reference in mm/zswap.c.
>
> Signed-off-by: Yosry Ahmed <yosryahmed@google.com>

Reviewed-by: Nhat Pham <nphamcs@gmail.com>
Chengming Zhou June 3, 2024, 6:04 a.m. UTC | #2
On 2024/5/24 11:38, Yosry Ahmed wrote:
> Eliminate the last explicit 'struct page' reference in mm/zswap.c.
> 
> Signed-off-by: Yosry Ahmed <yosryahmed@google.com>

LGTM, thanks!

Reviewed-by: Chengming Zhou <chengming.zhou@linux.dev>

> ---
>  mm/zswap.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/mm/zswap.c b/mm/zswap.c
> index 3693df96c81fe..bac66991fb14e 100644
> --- a/mm/zswap.c
> +++ b/mm/zswap.c
> @@ -1551,7 +1551,6 @@ bool zswap_load(struct folio *folio)
>  {
>  	swp_entry_t swp = folio->swap;
>  	pgoff_t offset = swp_offset(swp);
> -	struct page *page = &folio->page;
>  	bool swapcache = folio_test_swapcache(folio);
>  	struct xarray *tree = swap_zswap_tree(swp);
>  	struct zswap_entry *entry;
> @@ -1582,7 +1581,7 @@ bool zswap_load(struct folio *folio)
>  	if (entry->length)
>  		zswap_decompress(entry, folio);
>  	else {
> -		dst = kmap_local_page(page);
> +		dst = kmap_local_folio(folio, 0);
>  		zswap_fill_page(dst, entry->value);
>  		kunmap_local(dst);
>  	}
diff mbox series

Patch

diff --git a/mm/zswap.c b/mm/zswap.c
index 3693df96c81fe..bac66991fb14e 100644
--- a/mm/zswap.c
+++ b/mm/zswap.c
@@ -1551,7 +1551,6 @@  bool zswap_load(struct folio *folio)
 {
 	swp_entry_t swp = folio->swap;
 	pgoff_t offset = swp_offset(swp);
-	struct page *page = &folio->page;
 	bool swapcache = folio_test_swapcache(folio);
 	struct xarray *tree = swap_zswap_tree(swp);
 	struct zswap_entry *entry;
@@ -1582,7 +1581,7 @@  bool zswap_load(struct folio *folio)
 	if (entry->length)
 		zswap_decompress(entry, folio);
 	else {
-		dst = kmap_local_page(page);
+		dst = kmap_local_folio(folio, 0);
 		zswap_fill_page(dst, entry->value);
 		kunmap_local(dst);
 	}