Re: [PATCH v4 6/6] mm: migrate: remove folio_migrate_copy()

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

 



On 6/3/2024 2:24 AM, Kefeng Wang wrote:

The folio_migrate_copy() is just a wrapper of folio_copy() and
folio_migrate_flags(), it is simple and only aio use it for now,
unfold it and remove folio_migrate_copy().

Signed-off-by: Kefeng Wang <wangkefeng.wang@xxxxxxxxxx>
---
  fs/aio.c                | 3 ++-
  include/linux/migrate.h | 1 -
  mm/migrate.c            | 7 -------
  3 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/fs/aio.c b/fs/aio.c
index 07ff8bbdcd2a..bcee11fcb08b 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -455,7 +455,8 @@ static int aio_migrate_folio(struct address_space *mapping, struct folio *dst,
  	 * events from being lost.
  	 */
  	spin_lock_irqsave(&ctx->completion_lock, flags);
-	folio_migrate_copy(dst, src);
+	folio_copy(dst, src);
+	folio_migrate_flags(dst, src);
  	BUG_ON(ctx->ring_folios[idx] != src);
  	ctx->ring_folios[idx] = dst;
  	spin_unlock_irqrestore(&ctx->completion_lock, flags);
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index 517f70b70620..f9d92482d117 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -76,7 +76,6 @@ int migrate_huge_page_move_mapping(struct address_space *mapping,
  void migration_entry_wait_on_locked(swp_entry_t entry, spinlock_t *ptl)
  		__releases(ptl);
  void folio_migrate_flags(struct folio *newfolio, struct folio *folio);
-void folio_migrate_copy(struct folio *newfolio, struct folio *folio);
  int folio_migrate_mapping(struct address_space *mapping,
  		struct folio *newfolio, struct folio *folio, int extra_count);
diff --git a/mm/migrate.c b/mm/migrate.c
index e9b52a86f539..fe6ea3fb896e 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -652,13 +652,6 @@ void folio_migrate_flags(struct folio *newfolio, struct folio *folio)
  }
  EXPORT_SYMBOL(folio_migrate_flags);
-void folio_migrate_copy(struct folio *newfolio, struct folio *folio)
-{
-	folio_copy(newfolio, folio);
-	folio_migrate_flags(newfolio, folio);
-}
-EXPORT_SYMBOL(folio_migrate_copy);
-
  /************************************************************
   *                    Migration functions
   ***********************************************************/

Looks good!

Reviewed-by:  Jane Chu <jane.chu@xxxxxxxxx>

-jane





[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