[RFC PATCH v2 05/22] ntfs: Use PAGE_SIZE_MIN in NTFS_WOF_MAX_PAGES
From: Eric Curtin
Date: Tue Dec 01 2026 - 22:15:58 EST
From: Eric Curtin <eric.curtin@xxxxxxxxxx>
With arm64 boot-time page size selection PAGE_SIZE is not a compile-time
constant, but NTFS_WOF_MAX_PAGES sizes the folios[] and pages[] arrays.
Compute NTFS_WOF_MAX_PAGES with PAGE_SIZE_MIN, since the smallest page
size needs the most pages to hold a compression unit.
No functional change for compile-time page sizes.
Signed-off-by: Eric Curtin <eric.curtin@xxxxxxxxxx>
---
fs/ntfs/wof.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ntfs/wof.c b/fs/ntfs/wof.c
index 294dbe5d711f..708a0b71895d 100644
--- a/fs/ntfs/wof.c
+++ b/fs/ntfs/wof.c
@@ -33,7 +33,7 @@ static const __le16 WOF_NAME[] = {
#define NTFS_WOF_MAX_COMP_UNIT (1U << 15)
#define NTFS_WOF_MAX_PAGES \
- DIV_ROUND_UP(NTFS_WOF_MAX_COMP_UNIT + PAGE_SIZE - 1, PAGE_SIZE)
+ DIV_ROUND_UP(NTFS_WOF_MAX_COMP_UNIT + PAGE_SIZE_MIN - 1, PAGE_SIZE_MIN)
struct ntfs_wof_workspace {
struct mutex *lock;