diff options
| author | Matthew Wilcox (Oracle) <[email protected]> | 2024-08-22 13:50:09 +0000 |
|---|---|---|
| committer | Christian Brauner <[email protected]> | 2024-08-23 11:49:48 +0000 |
| commit | 84429b675bcfd2a518ae167ee4661cdf7539aa7d (patch) | |
| tree | 56481e9a481b7462737af124d0936ec3ecbf6930 /mm/filemap.c | |
| parent | Linux 6.11-rc1 (diff) | |
| download | kernel-84429b675bcfd2a518ae167ee4661cdf7539aa7d.tar.gz kernel-84429b675bcfd2a518ae167ee4661cdf7539aa7d.zip | |
fs: Allow fine-grained control of folio sizes
We need filesystems to be able to communicate acceptable folio sizes
to the pagecache for a variety of uses (e.g. large block sizes).
Support a range of folio sizes between order-0 and order-31.
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
Co-developed-by: Pankaj Raghav <[email protected]>
Signed-off-by: Pankaj Raghav <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Tested-by: David Howells <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Reviewed-by: Darrick J. Wong <[email protected]>
Reviewed-by: Daniel Gomez <[email protected]>
Signed-off-by: Christian Brauner <[email protected]>
Diffstat (limited to 'mm/filemap.c')
| -rw-r--r-- | mm/filemap.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/mm/filemap.c b/mm/filemap.c index d62150418b91..ad5e4a848070 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1933,10 +1933,8 @@ no_page: if (WARN_ON_ONCE(!(fgp_flags & (FGP_LOCK | FGP_FOR_MMAP)))) fgp_flags |= FGP_LOCK; - if (!mapping_large_folio_support(mapping)) - order = 0; - if (order > MAX_PAGECACHE_ORDER) - order = MAX_PAGECACHE_ORDER; + if (order > mapping_max_folio_order(mapping)) + order = mapping_max_folio_order(mapping); /* If we're not aligned, allocate a smaller folio */ if (index & ((1UL << order) - 1)) order = __ffs(index); |
