| From: Andrew Morton <akpm@linux-foundation.org> |
| Subject: mm-swap-use-the-swap-table-for-the-swap-cache-and-switch-api-fix |
| Date: Tue Sep 9 10:35:05 PM PDT 2025 |
| |
| fix CONFIG_SWAP=n |
| |
| Cc: Kairui Song <kasong@tencent.com> |
| Signed-off-by: Andrew Morton <akpm@linux-foundation.org> |
| --- |
| |
| mm/swap.h | 2 ++ |
| 1 file changed, 2 insertions(+) |
| |
| --- a/mm/swap.h~mm-swap-use-the-swap-table-for-the-swap-cache-and-switch-api-fix |
| +++ a/mm/swap.h |
| @@ -451,8 +451,10 @@ static inline int non_swapcache_batch(sw |
| */ |
| static inline pgoff_t folio_index(struct folio *folio) |
| { |
| +#ifdef CONFIG_MMU |
| if (unlikely(folio_test_swapcache(folio))) |
| return swp_offset(folio->swap); |
| +#endif |
| return folio->index; |
| } |
| |
| _ |