diff mbox series

[UPDATE,10/10] mm/migrate.c: call detach_page_private to cleanup code

Message ID 20200519214049.15179-1-guoqing.jiang@cloud.ionos.com (mailing list archive)
State New, archived
Headers show
Series None | expand

Commit Message

Guoqing Jiang May 19, 2020, 9:40 p.m. UTC
We can cleanup code a little by call detach_page_private here.

Signed-off-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
---
Add the cast to fix type mismatch warning, sorry for the mistake.

 mm/migrate.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/mm/migrate.c b/mm/migrate.c
index 7160c1556f79..44546d407e40 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -797,10 +797,7 @@  static int __buffer_migrate_page(struct address_space *mapping,
 	if (rc != MIGRATEPAGE_SUCCESS)
 		goto unlock_buffers;
 
-	ClearPagePrivate(page);
-	set_page_private(newpage, page_private(page));
-	set_page_private(page, 0);
-	put_page(page);
+	set_page_private(newpage, (unsigned long)detach_page_private(page));
 	get_page(newpage);
 
 	bh = head;