diff mbox series

[2/2] mm: memory: use folio in struct copy_subpage_arg

Message ID 20240613105344.2876119-2-wangkefeng.wang@huawei.com (mailing list archive)
State New
Headers show
Series [1/2] mm: convert clear_huge_page() to clear_large_folio() | expand

Commit Message

Kefeng Wang June 13, 2024, 10:53 a.m. UTC
Directly use folio in struct copy_subpage_arg.

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 mm/memory.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

David Hildenbrand June 14, 2024, 12:26 p.m. UTC | #1
On 13.06.24 12:53, Kefeng Wang wrote:
> Directly use folio in struct copy_subpage_arg.
> 
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---

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

Patch

diff --git a/mm/memory.c b/mm/memory.c
index 6ef84cd0b2bf..ca44da80fd47 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -6475,16 +6475,16 @@  static int copy_user_gigantic_page(struct folio *dst, struct folio *src,
 }
 
 struct copy_subpage_arg {
-	struct page *dst;
-	struct page *src;
+	struct folio *dst;
+	struct folio *src;
 	struct vm_area_struct *vma;
 };
 
 static int copy_subpage(unsigned long addr, int idx, void *arg)
 {
 	struct copy_subpage_arg *copy_arg = arg;
-	struct page *dst = nth_page(copy_arg->dst, idx);
-	struct page *src = nth_page(copy_arg->src, idx);
+	struct page *dst = folio_page(copy_arg->dst, idx);
+	struct page *src = folio_page(copy_arg->src, idx);
 
 	if (copy_mc_user_highpage(dst, src, addr, copy_arg->vma))
 		return -EHWPOISON;
@@ -6498,8 +6498,8 @@  int copy_user_large_folio(struct folio *dst, struct folio *src,
 	unsigned long addr = addr_hint &
 		~(((unsigned long)pages_per_huge_page << PAGE_SHIFT) - 1);
 	struct copy_subpage_arg arg = {
-		.dst = &dst->page,
-		.src = &src->page,
+		.dst = dst,
+		.src = src,
 		.vma = vma,
 	};