Re: [PATCH] mm/secretmem: use a folio in secretmem_fault()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Aug 12, 2023 at 09:58:35AM +0800, Peng Zhang wrote:
> From: ZhangPeng <zhangpeng362@xxxxxxxxxx>
> 
> Saves three implicit call to compound_head().

I count four!

>  		if (err) {
> -			put_page(page);
> +			folio_put(folio);
>  			ret = vmf_error(err);

One.

>  
> -		__SetPageUptodate(page);
> -		err = add_to_page_cache_lru(page, mapping, offset, gfp);
> +		__folio_mark_uptodate(folio);
> +		err = filemap_add_folio(mapping, folio, offset, gfp);

Two, three.

>  		if (unlikely(err)) {
> -			put_page(page);
> +			folio_put(folio);

Four!

Reviewed-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux