* + filemap-add-mapping_read_folio_gfp.patch added to mm-unstable branch
@ 2023-02-07 1:04 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2023-02-07 1:04 UTC (permalink / raw)
To: mm-commits, vbabka, surenb, shakeelb, rientjes, quic_pkondeti,
quic_charante, mhocko, markhemm, hughd, willy, akpm
The patch titled
Subject: filemap: add mapping_read_folio_gfp()
has been added to the -mm mm-unstable branch. Its filename is
filemap-add-mapping_read_folio_gfp.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/filemap-add-mapping_read_folio_gfp.patch
This patch will later appear in the mm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Subject: filemap: add mapping_read_folio_gfp()
Date: Mon, 6 Feb 2023 16:25:19 +0000
This is like read_cache_page_gfp() except it returns the folio instead
of the precise page.
Link: https://lkml.kernel.org/r/20230206162520.4029022-1-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Charan Teja Kalla <quic_charante@quicinc.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Mark Hemment <markhemm@googlemail.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Pavankumar Kondeti <quic_pkondeti@quicinc.com>
Cc: Shakeel Butt <shakeelb@google.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
--- a/include/linux/pagemap.h~filemap-add-mapping_read_folio_gfp
+++ a/include/linux/pagemap.h
@@ -756,6 +756,8 @@ static inline struct page *grab_cache_pa
struct folio *read_cache_folio(struct address_space *, pgoff_t index,
filler_t *filler, struct file *file);
+struct folio *mapping_read_folio_gfp(struct address_space *, pgoff_t index,
+ gfp_t flags);
struct page *read_cache_page(struct address_space *, pgoff_t index,
filler_t *filler, struct file *file);
extern struct page * read_cache_page_gfp(struct address_space *mapping,
--- a/mm/filemap.c~filemap-add-mapping_read_folio_gfp
+++ a/mm/filemap.c
@@ -3585,6 +3585,30 @@ struct folio *read_cache_folio(struct ad
}
EXPORT_SYMBOL(read_cache_folio);
+/**
+ * mapping_read_folio_gfp - Read into page cache, using specified allocation flags.
+ * @mapping: The address_space for the folio.
+ * @index: The index that the allocated folio will contain.
+ * @gfp: The page allocator flags to use if allocating.
+ *
+ * This is the same as "read_cache_folio(mapping, index, NULL, NULL)", but with
+ * any new memory allocations done using the specified allocation flags.
+ *
+ * The most likely error from this function is EIO, but ENOMEM is
+ * possible and so is EINTR. If ->read_folio returns another error,
+ * that will be returned to the caller.
+ *
+ * The function expects mapping->invalidate_lock to be already held.
+ *
+ * Return: Uptodate folio on success, ERR_PTR() on failure.
+ */
+struct folio *mapping_read_folio_gfp(struct address_space *mapping,
+ pgoff_t index, gfp_t gfp)
+{
+ return do_read_cache_folio(mapping, index, NULL, NULL, gfp);
+}
+EXPORT_SYMBOL(mapping_read_folio_gfp);
+
static struct page *do_read_cache_page(struct address_space *mapping,
pgoff_t index, filler_t *filler, struct file *file, gfp_t gfp)
{
_
Patches currently in -mm which might be from willy@infradead.org are
mm-add-memcpy_from_file_folio.patch
filemap-add-mapping_read_folio_gfp.patch
shmem-add-shmem_read_folio-and-shmem_read_folio_gfp.patch
shmem-fix-w=1-build-warnings-with-config_shmem=n.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-02-07 1:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-07 1:04 + filemap-add-mapping_read_folio_gfp.patch added to mm-unstable branch Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.