File tree Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -1108,10 +1108,10 @@ static int hugetlbfs_migrate_folio(struct address_space *mapping,
1108
1108
if (rc != MIGRATEPAGE_SUCCESS )
1109
1109
return rc ;
1110
1110
1111
- if (hugetlb_page_subpool ( & src -> page )) {
1112
- hugetlb_set_page_subpool ( & dst -> page ,
1113
- hugetlb_page_subpool ( & src -> page ));
1114
- hugetlb_set_page_subpool ( & src -> page , NULL );
1111
+ if (hugetlb_folio_subpool ( src )) {
1112
+ hugetlb_set_folio_subpool ( dst ,
1113
+ hugetlb_folio_subpool ( src ));
1114
+ hugetlb_set_folio_subpool ( src , NULL );
1115
1115
}
1116
1116
1117
1117
if (mode != MIGRATE_SYNC_NO_COPY )
Original file line number Diff line number Diff line change @@ -754,18 +754,29 @@ extern unsigned int default_hstate_idx;
754
754
755
755
#define default_hstate (hstates[default_hstate_idx])
756
756
757
+ static inline struct hugepage_subpool * hugetlb_folio_subpool (struct folio * folio )
758
+ {
759
+ return (void * )folio_get_private_1 (folio );
760
+ }
761
+
757
762
/*
758
763
* hugetlb page subpool pointer located in hpage[1].private
759
764
*/
760
765
static inline struct hugepage_subpool * hugetlb_page_subpool (struct page * hpage )
761
766
{
762
- return (void * )page_private (hpage + SUBPAGE_INDEX_SUBPOOL );
767
+ return hugetlb_folio_subpool (page_folio (hpage ));
768
+ }
769
+
770
+ static inline void hugetlb_set_folio_subpool (struct folio * folio ,
771
+ struct hugepage_subpool * subpool )
772
+ {
773
+ folio_set_private_1 (folio , (unsigned long )subpool );
763
774
}
764
775
765
776
static inline void hugetlb_set_page_subpool (struct page * hpage ,
766
777
struct hugepage_subpool * subpool )
767
778
{
768
- set_page_private ( hpage + SUBPAGE_INDEX_SUBPOOL , ( unsigned long ) subpool );
779
+ hugetlb_set_folio_subpool ( page_folio ( hpage ), subpool );
769
780
}
770
781
771
782
static inline struct hstate * hstate_file (struct file * f )
You can’t perform that action at this time.
0 commit comments