From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CAD1DC433ED for ; Mon, 5 Apr 2021 18:50:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 36B3A6124B for ; Mon, 5 Apr 2021 18:50:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 36B3A6124B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 944336B006E; Mon, 5 Apr 2021 14:50:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8F35F6B0073; Mon, 5 Apr 2021 14:50:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7BC346B0075; Mon, 5 Apr 2021 14:50:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0135.hostedemail.com [216.40.44.135]) by kanga.kvack.org (Postfix) with ESMTP id 5DD8F6B006E for ; Mon, 5 Apr 2021 14:50:40 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 226BA180AD81A for ; Mon, 5 Apr 2021 18:50:40 +0000 (UTC) X-FDA: 77999204640.05.C497B0D Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf27.hostedemail.com (Postfix) with ESMTP id 74EB980192E7 for ; Mon, 5 Apr 2021 18:50:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=pRQfujLgDot1kiIem/5XbHyxFit7Ph17hs4/MTFlKFY=; b=bUrNcXqsJSoO/Qd1ABZk/AFEM5 HilEtcXnE82Q1HyOP0leHdMZuQExMd7XF5OCVKUh4DlDt0dQRZYqLfl3PdOIo8XJjU7esXMVOa9xs 9c+kUNzO19s5k6GGMLq/lM+2nR46Z8Mi6xuEeOYFg9E2pZ0Z0gLTvdotHFzpdxTSppzmfogGh+M84 T1pQHU1MVhQrmkcftynMysoSJlHGWRapfOpUmP24PWRMoVINFE8iXH6796qny5ALjqbnhVmqlWIaV YpzqonteKQSbTeRcAqCD7w7+824JwNonOr/HIAzUZx8IizTTVcfeSI93f4TimofSz0iyRG0mxnivM MXZcFsww==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lTUIn-00BkwH-Gv; Mon, 05 Apr 2021 18:50:27 +0000 Date: Mon, 5 Apr 2021 19:50:21 +0100 From: Matthew Wilcox To: Mike Rapoport Cc: Andrew Morton , Mike Rapoport , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/2] minor cleanups of include/linux/mm.h Message-ID: <20210405185021.GK2531743@casper.infradead.org> References: <20210405151355.9867-1-rppt@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210405151355.9867-1-rppt@kernel.org> X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 74EB980192E7 X-Stat-Signature: 3zqoauerrwekmcatf5rup6oixg8x6ycm Received-SPF: none (infradead.org>: No applicable sender policy available) receiver=imf27; identity=mailfrom; envelope-from=""; helo=casper.infradead.org; client-ip=90.155.50.34 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1617648634-96726 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.