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
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
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 |
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(-)
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
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,
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
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
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
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
10 matches
Mail list logo