From: Matthew Wilcox <willy@infradead.org>
To: Mike Rapoport <rppt@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Mike Rapoport <rppt@linux.ibm.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/2] minor cleanups of include/linux/mm.h
Date: Mon, 5 Apr 2021 19:50:21 +0100 [thread overview]
Message-ID: <20210405185021.GK2531743@casper.infradead.org> (raw)
In-Reply-To: <20210405151355.9867-1-rppt@kernel.org>
On Mon, Apr 05, 2021 at 06:13:53PM +0300, Mike Rapoport wrote:
> I've also noticed that except page_mapping_file() we have somewhat similar
> page_file_mapping(), which seems superfluous, but I didn't dig further to
> see how one of them can be dropped.
They can't ;-( I looked at it, and they do different things.
+ * folio_file_mapping - Find the mapping this folio belongs to.
+ * @folio: The folio.
+ *
+ * For folios which are in the page cache, return the mapping that this
+ * page belongs to. Folios in the swap cache return the mapping of the
+ * swap file or swap device where the data is stored. This is different
+ * from the mapping returned by folio_mapping(). The only reason to
+ * use it is if, like NFS, you return 0 from ->activate_swapfile.
page_mapping_file() returns NULL for pages which are in the swap cache,
as they no longer need the dcache flushed.
prev parent reply other threads:[~2021-04-05 18:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-05 15:13 [PATCH 0/2] minor cleanups of include/linux/mm.h Mike Rapoport
2021-04-05 15:13 ` [PATCH 1/2] mm: move page_rmapping() and page_anon_vma() to mm/internal.h Mike Rapoport
2021-04-05 18:18 ` Matthew Wilcox
2021-04-05 20:00 ` kernel test robot
2021-04-05 15:13 ` [PATCH 2/2] include/linux/mm.h: remove duplicated declaration of page_mapping() Mike Rapoport
2021-04-05 18:16 ` Matthew Wilcox
2021-04-05 18:50 ` Matthew Wilcox [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210405185021.GK2531743@casper.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rppt@kernel.org \
--cc=rppt@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).