From patchwork Wed Nov 16 02:10:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 20659 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3048724wru; Tue, 15 Nov 2022 18:11:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf6TJJpc11dUtFgePd211xwFJQJUhgqfldyNFk3urogjTy4EGkROIwCdegnJecNmHepnMe0T X-Received: by 2002:a17:902:d54c:b0:187:31da:a27e with SMTP id z12-20020a170902d54c00b0018731daa27emr6774190plf.111.1668564691919; Tue, 15 Nov 2022 18:11:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668564691; cv=none; d=google.com; s=arc-20160816; b=JC4dIFq5RWIYG7AxFVfL5/fQ1Pt9DlkNwiNz0KBgIy+077M5DXHHFGEnxn8wxy7CoD 1ckeHBaJEg0TgyaoLJizKGLnHJhtSoCxdnf7mPYGUWb4Bwzwg+L2j2qylpD18Ygci+gl +ihGf3XVK+NI7hLPNXAbAvPdhDYNm6Rtu/ErcG/2J4eqxgb4z3kN9DPglhB3al0sVqVP di8OlfjRn7aMroDfcwwLCu6lBgRaV7wzgn7lXdIvcqe9FVODH3TyUpyGMlNbsPbokywq Zb/y7d7Swzg1nsH6UjygkDEun7Ecwpvw/DD3Q0GNHTRAoo2/i//9qaEv1GIPWq5Ni8jQ mcUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4nup6up+46eyh1lCBQu3VG6VwxyWmfFVyQ2yC43shVo=; b=rmDNkEZxFT5DRDOpCBaCnrxNFsEFOHevyqD/ZmXmyuCXIvb8yrYw3Tcn8PtqjPyo9l t0APE60M5e3p7YQJouBUtlVel95sXrCBkUiJFzKuNnRw9/pb0POzd2YQWerPv8ZBkYn1 XiQqheaNu/FrrPr8M+djSXBoo0ZqPjZMiIZfEuYtH7QDruqH1zUya5WZvjkS0G460aL7 HdNRXFQlmlrtAeCDvstDHTC09QGps2ptvYEYr/4GOSdB1x3Dmrn1nEyksG9pG/5x7PVn pG0WGPsibiGGOobWbD6o3Xkpz5I5pNzKD1sf6rIdzj3MZL/UjZSEshvZ7sz0NYDD4Ptp 4jFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kzTno0E7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bx16-20020a056a00429000b0056da577869asi13548426pfb.356.2022.11.15.18.11.18; Tue, 15 Nov 2022 18:11:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kzTno0E7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231869AbiKPCKb (ORCPT + 99 others); Tue, 15 Nov 2022 21:10:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231398AbiKPCKU (ORCPT ); Tue, 15 Nov 2022 21:10:20 -0500 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2042331DCB; Tue, 15 Nov 2022 18:10:20 -0800 (PST) Received: by mail-pj1-x1032.google.com with SMTP id k5so15222053pjo.5; Tue, 15 Nov 2022 18:10:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4nup6up+46eyh1lCBQu3VG6VwxyWmfFVyQ2yC43shVo=; b=kzTno0E757BuQUewd/lzW9JzWZhTRKoWJpj5TsOZemkW3irgjFx+JTcamrVEFZ+ZuK rd94aHMDRRsnMe5IjRTrRR0X2yA4oKZyt8VeJm0zlT3nKQE3H4iVnQ9nwf6cjVbIeRnN 9aAx+D1+N0y89hD+TmOP1QgFYR1ib5eKb91rk3P4CI2m5AyK49XRDYlA5AZv6+WkkBJ0 gu7a7WBBV/sVvJ43ubRL7RoJ8O18IT4nq/OSq62+8P+2AfbMzGGbzIWRDOwUmxcM/7kJ lr0+qQniPM4W/zw/ITl7D7XfrPmKiYARVg0tRSbciDRzhm5g/69Fs85CE+WQq0kwhja4 NOMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4nup6up+46eyh1lCBQu3VG6VwxyWmfFVyQ2yC43shVo=; b=Ed44bPwZMGmBYPiQ5i2Zzmy+DCs0XUDqdQYTCML+WT3GN2Q5abso3kxWOC/mWCYkg0 o7ayfE478rJSfVYraQeyc74YagY3NmmOit/kOZ4Rruuhoys23NVtpsi2qmQPiilJz7eJ r0qE5NAu1X182cFD1AI6fgEoOzwDk4lgrYddS0XYM/I7+BQ2z9ZOXa4RETBH99aBasIR Zs4dZTPXKRh7rtkI3lPyqSopPjqR48eBgTXkqtDp0y36LG2O4b0NN/T5gAPfSmexEK94 kGSZ6/UKXbM/nagIurqLjhSoiGSnOll7Bl2o3btcLlhVy8tuL0h3uDEeD/rrQwS3pKaH 9bMg== X-Gm-Message-State: ANoB5plBfJ2peSDoHNsm5x1qBKx6DbTkhw0AY7QaZLUNRdgK+OeE1HCn BKyVDYxmyyvQCIZqy6mtCtY= X-Received: by 2002:a17:90a:b392:b0:212:de1a:355b with SMTP id e18-20020a17090ab39200b00212de1a355bmr1406088pjr.1.1668564619604; Tue, 15 Nov 2022 18:10:19 -0800 (PST) Received: from fedora.hsd1.ca.comcast.net ([2601:644:8002:1c20::2c6b]) by smtp.googlemail.com with ESMTPSA id e18-20020a17090301d200b0018691ce1696sm10782926plh.131.2022.11.15.18.10.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 18:10:19 -0800 (PST) From: "Vishal Moola (Oracle)" To: linux-mm@kvack.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org, akpm@linux-foundation.org, willy@infradead.org, naoya.horiguchi@nec.com, tytso@mit.edu, "Vishal Moola (Oracle)" Subject: [PATCH 3/4] memory-failure: Convert truncate_error_page() to use folio Date: Tue, 15 Nov 2022 18:10:10 -0800 Message-Id: <20221116021011.54164-4-vishal.moola@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116021011.54164-1-vishal.moola@gmail.com> References: <20221116021011.54164-1-vishal.moola@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749616890314355442?= X-GMAIL-MSGID: =?utf-8?q?1749616890314355442?= Replaces try_to_release_page() with filemap_release_folio(). This change is in preparation for the removal of the try_to_release_page() wrapper. Signed-off-by: Vishal Moola (Oracle) Acked-by: Naoya Horiguchi --- mm/memory-failure.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 145bb561ddb3..92ec9b0e58a3 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -827,12 +827,13 @@ static int truncate_error_page(struct page *p, unsigned long pfn, int ret = MF_FAILED; if (mapping->a_ops->error_remove_page) { + struct folio *folio = page_folio(p); int err = mapping->a_ops->error_remove_page(mapping, p); if (err != 0) { pr_info("%#lx: Failed to punch page: %d\n", pfn, err); - } else if (page_has_private(p) && - !try_to_release_page(p, GFP_NOIO)) { + } else if (folio_has_private(folio) && + !filemap_release_folio(folio, GFP_NOIO)) { pr_info("%#lx: failed to release buffers\n", pfn); } else { ret = MF_RECOVERED;