From patchwork Tue Apr 23 22:55:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13640865 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFC50C10F15 for ; Tue, 23 Apr 2024 22:56:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 473026B018B; Tue, 23 Apr 2024 18:56:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3FC256B018D; Tue, 23 Apr 2024 18:56:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 29CBA6B018E; Tue, 23 Apr 2024 18:56:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 0AA8E6B018B for ; Tue, 23 Apr 2024 18:56:02 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id AA0C31A013E for ; Tue, 23 Apr 2024 22:56:01 +0000 (UTC) X-FDA: 82042306122.11.DACB5D7 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf28.hostedemail.com (Postfix) with ESMTP id 1C247C000D for ; Tue, 23 Apr 2024 22:55:59 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=FXyig58g; spf=none (imf28.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713912960; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=1UBrmnaxgdYln7b2mU/BBhde5q/G6uvD2LkDa5Pux+I=; b=bYOArB3m7r3YNLvj7fwf42NIvdNl7YKKGfMvuzX12YZ+YhKwOSk+TTEjOJrJh3Duh/Fqky avW2N51CwGvE+fPl2ehZnXYHL0BBoME26IFswVu011i5ePtD+GtN3bVC5EfclEECRqnzXj MDRwba3wxqBruztCKiBgzbQ6jfH0bhE= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=FXyig58g; spf=none (imf28.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713912960; a=rsa-sha256; cv=none; b=XOyag6mBdeiTfrt+x0DwjwuYc3LA+c9frZfpGUObg2dETxAp1+iio/v4BWYSNRg0QvV2io wbmx1bHYwCrcQT/+jSxS2gXdBOOPNnmphem0tl9U/vmfZMV8HIDGPYaX52CwCG9oSllXzp g/Z+7hAL1KMDchDE4KbcH5iK7I3q7mk= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=1UBrmnaxgdYln7b2mU/BBhde5q/G6uvD2LkDa5Pux+I=; b=FXyig58gEqE0F6D2bAAxl1bEFd TbFp9s4R4fwTdL3FoSptQkFN5bTLYpT2jK+iDm6A9Vd2xto13SwNEaT1EwGTWmHY1vfbQefgEJuOR b/BHY7oS1QcrvdIAreAEC6wH3j+qFshjaaKAPEK3+Po/R/mODKCCYi59tgvKXJci0zKzuL66k1o8i 4eYUH1+6nTLEPJc8Yut2z5NOHLc3JqxriqRcbP7ZBOS06YHw0F5qkjuzColyWuGAuOyZbByJWdqHu eN0FPCovV+XhG6nor35qADfuyXqAP339rkydvrF9oaJrG+/FwSONIFwhfZ9uaTxpLs0ZwZSOumrKM mX1TZc+Q==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzP3K-0000000HG6I-1wTt; Tue, 23 Apr 2024 22:55:54 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton , linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" , linux-fsdevel@vger.kernel.org, linux-fscrypt@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH 3/6] memory-failure: Remove calls to page_mapping() Date: Tue, 23 Apr 2024 23:55:34 +0100 Message-ID: <20240423225552.4113447-4-willy@infradead.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240423225552.4113447-1-willy@infradead.org> References: <20240423225552.4113447-1-willy@infradead.org> MIME-Version: 1.0 X-Stat-Signature: mk4h3bncudjneb8dnhgtxweww3ehmiae X-Rspamd-Queue-Id: 1C247C000D X-Rspamd-Server: rspam02 X-Rspam-User: X-HE-Tag: 1713912959-118325 X-HE-Meta: U2FsdGVkX1+WDgAtQYcxMeXcpI3ojcE1v3prTV6JdzLDbYpZu7NU/QV47hmg/zsjrMlrGWA0y7VF/ow+m9NPaGHUSXOmufv6uq7pR9zDmu3/eIU8OZVtkT3l6+jWLdc5mggXS6aWCHaDVqlMBsRWaYEiofQmyJrK3fZZtfAknpQyVLrc4vPevWhCZg77of0fe5Y8+Yhm+Bi0LYtUbmAAPUrJEf22s4ZBgAOQyhWu+HCqlW5ZFH7JtKr7RWH2LMMlSElMhuUVHqWfOvqFb9waFlK9Ow50FczsZnjFu7p0cgM8+GdqVsSdpKOuW4jeRXg0eE8ak2JgwAQpCKVNs3/xv3tfaRAfTl5EuziAnsp/MT5BACJ8PeJSIWgSJblS7bSDBJMfBp47gEgI4YZxfre0QuAREM6eN42J3wE29DmnQszdVLhEamVYmj6SdHHg5wNpdUh42IpDpNHDuS+7NghSJN0bfiZaHb55lYRF0j8f6tjWsSafCG+rGLsLj5Im9N1jX7kZCSTErRMP3wIkeJ6vwUU/guj3N6IukrboGZ6i7YrIeYzwa5qdUYlIY2cGO00owlLFyDgs/flFwJT4FLxDNuKUfajjph1Id8GAqGFOf6QfkUsE6GMvFLpHPtX7GH3S4Z5rUz1pV/Zz0UxbRJOXMAUDuDPO25HUppSvvaaw3+gT+Z+Yv6nNuN0Ct1UxJcIXKRukMFEJaAQy3ypIt+3jiTck3sSbPykq3k0rNDXVXj7C7Q5p3XMbMQH3anl6CHxehc9XkcrBBJjp4th6XHvnxdscDS50dyv0ojQhoPZhhBBvvOC+locEVrFaLKJY3ClA/RikkdYdlawhxCGwS/ArTy3prCF4RZ9EUzC/TUQe4NwJslEd/PbtqOhsTHOKyOg5i3bsbkc6ipZiW/qijFH+TvdiXaUWAGiwtlBTUK1SayVBwD/yA6lMqbx92ReYPD1epHHkCKcjTVMwHbaukrC L/jG88Z2 mdjnI4EjYUlWqcWY79GwjNhuiHYMRJvYz26hkmANkKmWJXa8uTptJ+We6iYUNkwBlHu9jk4V/Tp1jnuqZNhTu++JlhjkN5xED1w9sQ9jKbVhtlCe7uULGVXddiHIROC3CO+IEJEuREKOfvVjWK1ZxYuKMhiZTWqtKLK7wthQT/vsXBeQfUuLoF/0Q3vyQFPtL4MB2oSK0dTzVjRaNCdLtnTmS1UEYpCxWRTVu 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: List-Subscribe: List-Unsubscribe: This is mostly just inlining page_mapping() into the two callers. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Sidhartha Kumar Reviewed-by: David Hildenbrand Acked-by: Miaohe Lin --- mm/memory-failure.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index e065dd9be21e..62aa3db17854 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -216,6 +216,7 @@ EXPORT_SYMBOL_GPL(hwpoison_filter_flags_value); static int hwpoison_filter_dev(struct page *p) { + struct folio *folio = page_folio(p); struct address_space *mapping; dev_t dev; @@ -223,7 +224,7 @@ static int hwpoison_filter_dev(struct page *p) hwpoison_filter_dev_minor == ~0U) return 0; - mapping = page_mapping(p); + mapping = folio_mapping(folio); if (mapping == NULL || mapping->host == NULL) return -EINVAL; @@ -1090,7 +1091,8 @@ static int me_pagecache_clean(struct page_state *ps, struct page *p) */ static int me_pagecache_dirty(struct page_state *ps, struct page *p) { - struct address_space *mapping = page_mapping(p); + struct folio *folio = page_folio(p); + struct address_space *mapping = folio_mapping(folio); /* TBD: print more information about the file. */ if (mapping) {