diff mbox series

[3/4] fb_defio: use a folio in fb_deferred_io_work()

Message ID 20240604114822.2089819-4-wangkefeng.wang@huawei.com (mailing list archive)
State New
Headers show
Series mm: remove page_maybe_dma_pinned() and page_mkclean() | expand

Commit Message

Kefeng Wang June 4, 2024, 11:48 a.m. UTC
Replaces three calls to compound_head() with one, which removes last
caller of page_mkclean().

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 drivers/video/fbdev/core/fb_defio.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

David Hildenbrand June 4, 2024, 11:53 a.m. UTC | #1
On 04.06.24 13:48, Kefeng Wang wrote:
> Replaces three calls to compound_head() with one, which removes last
> caller of page_mkclean().
> 
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
>   drivers/video/fbdev/core/fb_defio.c | 9 +++++----
>   1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/video/fbdev/core/fb_defio.c b/drivers/video/fbdev/core/fb_defio.c
> index 806ecd32219b..c9c8e294b7e7 100644
> --- a/drivers/video/fbdev/core/fb_defio.c
> +++ b/drivers/video/fbdev/core/fb_defio.c
> @@ -244,10 +244,11 @@ static void fb_deferred_io_work(struct work_struct *work)
>   	/* here we mkclean the pages, then do all deferred IO */
>   	mutex_lock(&fbdefio->lock);
>   	list_for_each_entry(pageref, &fbdefio->pagereflist, list) {
> -		struct page *cur = pageref->page;
> -		lock_page(cur);
> -		page_mkclean(cur);
> -		unlock_page(cur);
> +		struct folio *folio = page_folio(pageref->page);
> +
> +		folio_lock(folio);
> +		folio_mkclean(folio);
> +		folio_unlock(folio);
>   	}
>   
>   	/* driver's callback with pagereflist */

Acked-by: David Hildenbrand <david@redhat.com>
diff mbox series

Patch

diff --git a/drivers/video/fbdev/core/fb_defio.c b/drivers/video/fbdev/core/fb_defio.c
index 806ecd32219b..c9c8e294b7e7 100644
--- a/drivers/video/fbdev/core/fb_defio.c
+++ b/drivers/video/fbdev/core/fb_defio.c
@@ -244,10 +244,11 @@  static void fb_deferred_io_work(struct work_struct *work)
 	/* here we mkclean the pages, then do all deferred IO */
 	mutex_lock(&fbdefio->lock);
 	list_for_each_entry(pageref, &fbdefio->pagereflist, list) {
-		struct page *cur = pageref->page;
-		lock_page(cur);
-		page_mkclean(cur);
-		unlock_page(cur);
+		struct folio *folio = page_folio(pageref->page);
+
+		folio_lock(folio);
+		folio_mkclean(folio);
+		folio_unlock(folio);
 	}
 
 	/* driver's callback with pagereflist */