[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210405185021.GK2531743@casper.infradead.org>
Date: Mon, 5 Apr 2021 19:50:21 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Mike Rapoport <rppt@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Mike Rapoport <rppt@...ux.ibm.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 0/2] minor cleanups of include/linux/mm.h
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.
Powered by blists - more mailing lists