[Cluster-devel] return an ERR_PTR from __filemap_get_folio v2

2023-01-20 Thread Christoph Hellwig
Hi all, __filemap_get_folio and its wrappers can return NULL for three different conditions, which in some cases requires the caller to reverse engineer the decision making. This is fixed by returning an ERR_PTR instead of NULL and thus transporting the reason for the failure. But to make that

[Cluster-devel] [PATCH 7/7] mm: return an ERR_PTR from __filemap_get_folio

2023-01-20 Thread Christoph Hellwig
Instead of returning NULL for all errors, distinguish between: - no entry found and not asked to allocated (-ENOENT) - failed to allocate memory (-ENOMEM) - would block (-EAGAIN) so that callers don't have to guess the error based on the passed in flags. Also pass through the error through

[Cluster-devel] [PATCH 3/7] mm: use filemap_get_entry in filemap_get_incore_folio

2023-01-20 Thread Christoph Hellwig
filemap_get_incore_folio wants to look at the details of xa_is_value entries, but doesn't need any of the other logic in filemap_get_folio. Switch it to use the lower-level filemap_get_entry interface. Signed-off-by: Christoph Hellwig Reviewed-by: Matthew Wilcox (Oracle) --- mm/swap_state.c |

[Cluster-devel] [PATCH 1/7] mm: don't look at xarray value entries in split_huge_pages_in_file

2023-01-20 Thread Christoph Hellwig
split_huge_pages_in_file never wants to do anything with the special value enties. Switch to using filemap_get_folio to not even see them. Signed-off-by: Christoph Hellwig Reviewed-by: Matthew Wilcox (Oracle) --- mm/huge_memory.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)

[Cluster-devel] [PATCH 6/7] mm: remove FGP_ENTRY

2023-01-20 Thread Christoph Hellwig
FGP_ENTRY is unused now, so remove it. Signed-off-by: Christoph Hellwig --- include/linux/pagemap.h | 3 +-- mm/filemap.c| 7 +-- mm/folio-compat.c | 4 ++-- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h

[Cluster-devel] [PATCH 4/7] shmem: remove shmem_get_partial_folio

2023-01-20 Thread Christoph Hellwig
Add a new SGP_FIND mode for shmem_get_partial_folio that works like SGP_READ, but does not check i_size. Use that instead of open coding the page cache lookup in shmem_get_partial_folio. Note that this is a behavior change in that it reads in swap cache entries for offsets outside i_size,

[Cluster-devel] [PATCH 5/7] shmem: open code the page cache lookup in shmem_get_folio_gfp

2023-01-20 Thread Christoph Hellwig
Use the very low level filemap_get_entry helper to look up the entry in the xarray, and then: - don't bother locking the folio if only doing a userfault notification - open code locking the page and checking for truncation in a related code block This will allow to eventually remove the

[Cluster-devel] [PATCH 2/7] mm: make mapping_get_entry available outside of filemap.c

2023-01-20 Thread Christoph Hellwig
mapping_get_entry is useful for page cache API users that need to know about xa_value internals. Rename it and make it available in pagemap.h. Signed-off-by: Christoph Hellwig Reviewed-by: Matthew Wilcox (Oracle) --- include/linux/pagemap.h | 1 + mm/filemap.c| 6 +++--- 2 files

[Cluster-devel] [PATCH] Revert "gfs2: stop using generic_writepages in gfs2_ail1_start_one"

2023-01-20 Thread Andreas Gruenbacher
Commit b2b0a5e97855 switched from generic_writepages() to filemap_fdatawrite_wbc() in gfs2_ail1_start_one() on the path to replacing ->writepage() with ->writepages() and eventually eliminating the former. Function gfs2_ail1_start_one() is called from gfs2_log_flush(), our main function for

[Cluster-devel] [PATCH] mkfs.gfs2: Add a root_inherit_jdata extended option

2023-01-20 Thread Andrew Price
Add an extended option to allow the GFS2_DIF_INHERIT_JDATA flag to be set on the root dinode at mkfs time. This option is only to be used for testing so it is not documented. Signed-off-by: Andrew Price --- gfs2/mkfs/main_mkfs.c | 27 +++ tests/mkfs.at | 16