From patchwork Fri May 26 07:55:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13256608 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 0C356C7EE23 for ; Fri, 26 May 2023 08:54:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 68F1F6B0075; Fri, 26 May 2023 04:54:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 63F396B0078; Fri, 26 May 2023 04:54:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4E1496B007B; Fri, 26 May 2023 04:54:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 3A77F6B0075 for ; Fri, 26 May 2023 04:54:12 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 09B44C030C for ; Fri, 26 May 2023 08:54:12 +0000 (UTC) X-FDA: 80831794344.12.926F079 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf19.hostedemail.com (Postfix) with ESMTP id 64D961A0013 for ; Fri, 26 May 2023 08:54:10 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=pl0lkfgo; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=none (imf19.hostedemail.com: domain of mcgrof@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=mcgrof@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685091250; h=from:from:sender: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=BFzqBMItEZgQr8hCk3V5r6qhiIrmiWlEy/D5f4lnA2E=; b=Vk/GiyK1tSUXyuv5QULvN1Qlix6bVh7PmDoQAl+db45TBdKrEkxqgS5jYG5TQ0HHVd7ABf +UA86N9GQYGPVmq8sy3af2PZBtSCbxsCOYP80FPvR9Qckmx5kFvClrlVpEPj1tIm+Eqznk fwSI0IeC58I1J1/G8gaVsVpX1kB2nZA= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=pl0lkfgo; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=none (imf19.hostedemail.com: domain of mcgrof@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=mcgrof@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685091250; a=rsa-sha256; cv=none; b=2sF1iGZhIDljl35irRmCthaF3hvXRC4ghd5st7VEOXNn+O7hr2INk/YYk5TJqOEwqHBcW4 KQ4XXlS9uAj5ZubDFfYUYp53qDOfDkhdTMmUNsz6mwAFPjkhpKCGYGK8o3HBHogybNuDW7 K5vgxjif0QIFQSlG4j3l9/AKpB/d2Vo= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=BFzqBMItEZgQr8hCk3V5r6qhiIrmiWlEy/D5f4lnA2E=; b=pl0lkfgoZtZTjPznudekY5HK9v zjooPlpEqlCsqaFtZOKe2oOkIsjXewFeAQUggQ0csrXmSEg/LbbbdByZrqoA1JUWEE/IU4kNuymSJ 2PQI3eei+8ip/2EgJUWqJQ6fyolpTquvIN/Of0kbRh1En7RzoMnd5svO6VEDqQ5FNLqtaeoergkmA daR7xOt3hf8BaukiXWg6nQ/9K/UWIgZ0z4x0y7N0NMwIzBK8u4CbLDUJKSFkxKC+aR8FG7TqHLNvl 4k8J+vfFgnEXegtEH6jRcR3cZIkGRcxjX4qlO5MaTXcafNcifBPHAdfH3KlUS18vB41SdwI5z1HLe vCHZUpSw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1q2SIj-001WZj-2b; Fri, 26 May 2023 07:55:53 +0000 From: Luis Chamberlain To: hughd@google.com, akpm@linux-foundation.org, willy@infradead.org, brauner@kernel.org, djwong@kernel.org Cc: p.raghav@samsung.com, da.gomez@samsung.com, rohan.puri@samsung.com, rpuri.linux@gmail.com, a.manzanares@samsung.com, dave@stgolabs.net, yosryahmed@google.com, keescook@chromium.org, hare@suse.de, kbusch@kernel.org, mcgrof@kernel.org, patches@lists.linux.dev, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [RFC v2 2/8] shmem: convert to use is_folio_hwpoison() Date: Fri, 26 May 2023 00:55:46 -0700 Message-Id: <20230526075552.363524-3-mcgrof@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230526075552.363524-1-mcgrof@kernel.org> References: <20230526075552.363524-1-mcgrof@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 64D961A0013 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: jts763c9k67ogkf8suuyucsuh3mepq6b X-HE-Tag: 1685091250-681535 X-HE-Meta: U2FsdGVkX1+B47mXApPn6OMaUEE5P0sDp4WYcgXqfK76sc1OHO4jC/dVHjgNa6l/4IQQOex9yAK8qS71DMcSCiVFYP3BET4QtC2q9GRkwtmRGYJuk5WJk+FxxW+K9dQXvOoJ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6UWTVbcUU13RFpPSUN3bLbYR7SkJbhPZYwuX33j6Qt3lz3zVszbFp14Rr8DBzYwDLMl3PllVZhxcLO73lUveb3gLAwFTRaaW4xT+A+oQ3eQ///4JOO2fhg+eY5ho5d2gDxHA253Gz7n2If3Phbi/PFoPaisFTO29ahyZ47QBEn02u2e9KJEyJvc7jDZYDH1FPmwP+10TgXN5ks39W8V13/aubbjLnGnPkCHHCkitPqPJl6AEFoW4KnY2a4aHgYkzuT0961nPfnXAND4tdpwoMwg64nYyIJDksEK64ed1gQuc= 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: The PageHWPoison() call can be converted over to the respective folio call is_folio_hwpoison(). This introduces no functional changes. Signed-off-by: Luis Chamberlain --- mm/shmem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index 351803415ad2..a947f2678a39 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -3360,7 +3360,7 @@ static const char *shmem_get_link(struct dentry *dentry, folio = filemap_get_folio(inode->i_mapping, 0); if (IS_ERR(folio)) return ERR_PTR(-ECHILD); - if (PageHWPoison(folio_page(folio, 0)) || + if (is_folio_hwpoison(folio) || !folio_test_uptodate(folio)) { folio_put(folio); return ERR_PTR(-ECHILD); @@ -3371,7 +3371,7 @@ static const char *shmem_get_link(struct dentry *dentry, return ERR_PTR(error); if (!folio) return ERR_PTR(-ECHILD); - if (PageHWPoison(folio_page(folio, 0))) { + if (is_folio_hwpoison(folio)) { folio_unlock(folio); folio_put(folio); return ERR_PTR(-ECHILD); @@ -4548,7 +4548,7 @@ struct page *shmem_read_mapping_page_gfp(struct address_space *mapping, return &folio->page; page = folio_file_page(folio, index); - if (PageHWPoison(page)) { + if (is_folio_hwpoison(folio)) { folio_put(folio); return ERR_PTR(-EIO); }