From patchwork Mon Jan 9 05:18:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 40671 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1992121wrt; Sun, 8 Jan 2023 21:50:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXsH39mmRLe57mOcYYSUi0i7Fs7xZJNugpyEk6/7yDQRXqJpJ+8qndKJ6FL249w5LA/A2IOG X-Received: by 2002:aa7:cb4b:0:b0:491:3a5c:6e5 with SMTP id w11-20020aa7cb4b000000b004913a5c06e5mr18015883edt.1.1673243439926; Sun, 08 Jan 2023 21:50:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673243439; cv=none; d=google.com; s=arc-20160816; b=fxXhP8pfNmQWMmyamKCqRUsqM51KM5REgL8/3ejqOwlLT9H+jQpYXyGaeFUgm8RVf7 etwgTnEs9DhAD4PpxiKiA5cOWU3JQbwQD4uQgXkBsg4AZPNY/e3P7wpu8AQ3u2D9cUWC lE+ETRNgv6OR+m4STbj8DtMnwfhEknhqzmA3OKpdw2g8YK90edpgJQpISEhp7Jhjgt89 655NCVKICjaMQJE3zHSTXiougrbnqW7vYoFuH4pSFXWNdPoKhAyiuYMp9Rguapny/T8/ RF+oZFslcqbx4jEceb3zDIlvALv9jTXEW3JFUurUCU6moetnuvsGXYKWvZVj3vb3QB1Q blNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=ka5+iF4ZHGa0/h4sTq7sbQGVl9e8Q3iYzmlIIaQ/sWI=; b=k5PppBLaBLnYhgtzR4CHM3ca2OQ/L+DOVoD4maSYXMCW2NagIO6ds4JDqSMY1gzl1l 6AN+2MkgRq40c33mewuN9sWFNyDlraSMmq5NKETmZRitvCL3DjEVQ3k1itptlAij9Dza hN9ajWc+sOUCnOzwvpJYYhK4w3rGnNg1G24ObAD4qCpWgT54ceG42T5rzmmXvPaALXZz 1vg2RDPdVYCXLQhK+s7xXQDmTMLtsx2ZX1NIFRyXXkA0oh6HaEor+afFfmdsV0QyrVm6 ZnNzqgTFjJUMN+eEFQvoPNrt99pUosycRG38gtJb4slOzsFE6BcMjVW14ydpGfmZjC3L nUVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b="i/qCQROx"; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id em8-20020a056402364800b0048ec063ea63si8411176edb.396.2023.01.08.21.50.16; Sun, 08 Jan 2023 21:50:39 -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=fail header.i=@infradead.org header.s=casper.20170209 header.b="i/qCQROx"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236593AbjAIFTt (ORCPT + 99 others); Mon, 9 Jan 2023 00:19:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234878AbjAIFSY (ORCPT ); Mon, 9 Jan 2023 00:18:24 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D69A6DE80; Sun, 8 Jan 2023 21:18:23 -0800 (PST) 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=ka5+iF4ZHGa0/h4sTq7sbQGVl9e8Q3iYzmlIIaQ/sWI=; b=i/qCQROxWBGYJBbp7WWwA2/Yvw Dp51Rqs4Jyu0jDo2hlrt+BgXNzbaN0GGMq7jiZbomx7g2Z1moIfQd4S26iD20Wx1lgwxVcVVLJlfB m3oJgbKQ7cxdKfhGyEArj6Pdh/Vavd0nsnL+WwFB9DYdYPvjEMdayAceV2jqlDwDfoc1bB9+8xv/W 2sD8mcl3FP9+WTM0o7s8uiBCj5KapY4EWuMdX7aB0vExNWT2/2+ku+8olFqdDnvPmw9+fspzT718R 3MzT+pW9s1EyjLZYJH8nv6yJcMkiJnMmFZLvaNPl+bbgf4FKlttTj+F+vUdAZFW0YOKrcSrFt4Nfx AQo3heCw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pEkYD-0020wp-46; Mon, 09 Jan 2023 05:18:25 +0000 From: "Matthew Wilcox (Oracle)" Cc: "Matthew Wilcox (Oracle)" , Jeff Layton , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Christoph Hellwig Subject: [PATCH 02/11] filemap: Remove filemap_check_and_keep_errors() Date: Mon, 9 Jan 2023 05:18:14 +0000 Message-Id: <20230109051823.480289-3-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230109051823.480289-1-willy@infradead.org> References: <20230109051823.480289-1-willy@infradead.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) 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?1754522913234715418?= X-GMAIL-MSGID: =?utf-8?q?1754522913234715418?= Convert both callers to use the "new" errseq infrastructure. Signed-off-by: Matthew Wilcox (Oracle) --- mm/filemap.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/mm/filemap.c b/mm/filemap.c index c4d4ace9cc70..48daedc224d9 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -355,16 +355,6 @@ int filemap_check_errors(struct address_space *mapping) } EXPORT_SYMBOL(filemap_check_errors); -static int filemap_check_and_keep_errors(struct address_space *mapping) -{ - /* Check for outstanding write errors */ - if (test_bit(AS_EIO, &mapping->flags)) - return -EIO; - if (test_bit(AS_ENOSPC, &mapping->flags)) - return -ENOSPC; - return 0; -} - /** * filemap_fdatawrite_wbc - start writeback on mapping dirty pages in range * @mapping: address space structure to write @@ -567,8 +557,10 @@ EXPORT_SYMBOL(filemap_fdatawait_range); int filemap_fdatawait_range_keep_errors(struct address_space *mapping, loff_t start_byte, loff_t end_byte) { + errseq_t since = filemap_sample_wb_err(mapping); + __filemap_fdatawait_range(mapping, start_byte, end_byte); - return filemap_check_and_keep_errors(mapping); + return filemap_check_wb_err(mapping, since); } EXPORT_SYMBOL(filemap_fdatawait_range_keep_errors); @@ -613,8 +605,10 @@ EXPORT_SYMBOL(file_fdatawait_range); */ int filemap_fdatawait_keep_errors(struct address_space *mapping) { + errseq_t since = filemap_sample_wb_err(mapping); + __filemap_fdatawait_range(mapping, 0, LLONG_MAX); - return filemap_check_and_keep_errors(mapping); + return filemap_check_wb_err(mapping, since); } EXPORT_SYMBOL(filemap_fdatawait_keep_errors);