@@ -231,18 +231,17 @@ static void putback_movable_ops_page(struct page *page)
231231 * src and dst are also released by migration core. These pages will not be
232232 * folios in the future, so that must be reworked.
233233 *
234- * Returns MIGRATEPAGE_SUCCESS on success, otherwise a negative error
235- * code.
234+ * Returns 0 on success, otherwise a negative error code.
236235 */
237236static int migrate_movable_ops_page (struct page * dst , struct page * src ,
238237 enum migrate_mode mode )
239238{
240- int rc = MIGRATEPAGE_SUCCESS ;
239+ int rc ;
241240
242241 VM_WARN_ON_ONCE_PAGE (!page_has_movable_ops (src ), src );
243242 VM_WARN_ON_ONCE_PAGE (!PageMovableOpsIsolated (src ), src );
244243 rc = page_movable_ops (src )-> migrate_page (dst , src , mode );
245- if (rc == MIGRATEPAGE_SUCCESS )
244+ if (! rc )
246245 ClearPageMovableOpsIsolated (src );
247246 return rc ;
248247}
@@ -587,7 +586,7 @@ static int __folio_migrate_mapping(struct address_space *mapping,
587586 if (folio_test_swapbacked (folio ))
588587 __folio_set_swapbacked (newfolio );
589588
590- return MIGRATEPAGE_SUCCESS ;
589+ return 0 ;
591590 }
592591
593592 oldzone = folio_zone (folio );
@@ -688,7 +687,7 @@ static int __folio_migrate_mapping(struct address_space *mapping,
688687 }
689688 local_irq_enable ();
690689
691- return MIGRATEPAGE_SUCCESS ;
690+ return 0 ;
692691}
693692
694693int folio_migrate_mapping (struct address_space * mapping ,
@@ -737,7 +736,7 @@ int migrate_huge_page_move_mapping(struct address_space *mapping,
737736
738737 xas_unlock_irq (& xas );
739738
740- return MIGRATEPAGE_SUCCESS ;
739+ return 0 ;
741740}
742741
743742/*
@@ -853,14 +852,14 @@ static int __migrate_folio(struct address_space *mapping, struct folio *dst,
853852 return rc ;
854853
855854 rc = __folio_migrate_mapping (mapping , dst , src , expected_count );
856- if (rc != MIGRATEPAGE_SUCCESS )
855+ if (rc )
857856 return rc ;
858857
859858 if (src_private )
860859 folio_attach_private (dst , folio_detach_private (src ));
861860
862861 folio_migrate_flags (dst , src );
863- return MIGRATEPAGE_SUCCESS ;
862+ return 0 ;
864863}
865864
866865/**
@@ -967,7 +966,7 @@ static int __buffer_migrate_folio(struct address_space *mapping,
967966 }
968967
969968 rc = filemap_migrate_folio (mapping , dst , src , mode );
970- if (rc != MIGRATEPAGE_SUCCESS )
969+ if (rc )
971970 goto unlock_buffers ;
972971
973972 bh = head ;
@@ -1071,7 +1070,7 @@ static int fallback_migrate_folio(struct address_space *mapping,
10711070 *
10721071 * Return value:
10731072 * < 0 - error code
1074- * MIGRATEPAGE_SUCCESS - success
1073+ * 0 - success
10751074 */
10761075static int move_to_new_folio (struct folio * dst , struct folio * src ,
10771076 enum migrate_mode mode )
@@ -1099,7 +1098,7 @@ static int move_to_new_folio(struct folio *dst, struct folio *src,
10991098 else
11001099 rc = fallback_migrate_folio (mapping , dst , src , mode );
11011100
1102- if (rc == MIGRATEPAGE_SUCCESS ) {
1101+ if (! rc ) {
11031102 /*
11041103 * For pagecache folios, src->mapping must be cleared before src
11051104 * is freed. Anonymous folios must stay anonymous until freed.
@@ -1449,7 +1448,7 @@ static int unmap_and_move_huge_page(new_folio_t get_new_folio,
14491448 if (folio_ref_count (src ) == 1 ) {
14501449 /* page was freed from under us. So we are done. */
14511450 folio_putback_hugetlb (src );
1452- return MIGRATEPAGE_SUCCESS ;
1451+ return 0 ;
14531452 }
14541453
14551454 dst = get_new_folio (src , private );
@@ -1512,8 +1511,7 @@ static int unmap_and_move_huge_page(new_folio_t get_new_folio,
15121511 rc = move_to_new_folio (dst , src , mode );
15131512
15141513 if (page_was_mapped )
1515- remove_migration_ptes (src ,
1516- rc == MIGRATEPAGE_SUCCESS ? dst : src , 0 );
1514+ remove_migration_ptes (src , !rc ? dst : src , 0 );
15171515
15181516unlock_put_anon :
15191517 folio_unlock (dst );
@@ -1522,15 +1520,15 @@ static int unmap_and_move_huge_page(new_folio_t get_new_folio,
15221520 if (anon_vma )
15231521 put_anon_vma (anon_vma );
15241522
1525- if (rc == MIGRATEPAGE_SUCCESS ) {
1523+ if (! rc ) {
15261524 move_hugetlb_state (src , dst , reason );
15271525 put_new_folio = NULL ;
15281526 }
15291527
15301528out_unlock :
15311529 folio_unlock (src );
15321530out :
1533- if (rc == MIGRATEPAGE_SUCCESS )
1531+ if (! rc )
15341532 folio_putback_hugetlb (src );
15351533 else if (rc != - EAGAIN )
15361534 list_move_tail (& src -> lru , ret );
@@ -1640,7 +1638,7 @@ static int migrate_hugetlbs(struct list_head *from, new_folio_t get_new_folio,
16401638 reason , ret_folios );
16411639 /*
16421640 * The rules are:
1643- * Success : hugetlb folio will be put back
1641+ * 0 : hugetlb folio will be put back
16441642 * -EAGAIN: stay on the from list
16451643 * -ENOMEM: stay on the from list
16461644 * Other errno: put on ret_folios list
@@ -1657,7 +1655,7 @@ static int migrate_hugetlbs(struct list_head *from, new_folio_t get_new_folio,
16571655 retry ++ ;
16581656 nr_retry_pages += nr_pages ;
16591657 break ;
1660- case MIGRATEPAGE_SUCCESS :
1658+ case 0 :
16611659 stats -> nr_succeeded += nr_pages ;
16621660 break ;
16631661 default :
@@ -1711,7 +1709,7 @@ static void migrate_folios_move(struct list_head *src_folios,
17111709 reason , ret_folios );
17121710 /*
17131711 * The rules are:
1714- * Success : folio will be freed
1712+ * 0 : folio will be freed
17151713 * -EAGAIN: stay on the unmap_folios list
17161714 * Other errno: put on ret_folios list
17171715 */
@@ -1721,7 +1719,7 @@ static void migrate_folios_move(struct list_head *src_folios,
17211719 * thp_retry += is_thp ;
17221720 * nr_retry_pages += nr_pages ;
17231721 break ;
1724- case MIGRATEPAGE_SUCCESS :
1722+ case 0 :
17251723 stats -> nr_succeeded += nr_pages ;
17261724 stats -> nr_thp_succeeded += is_thp ;
17271725 break ;
0 commit comments