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 (Oracle)" X-Patchwork-Id: 13093062 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 3434CC61DB3 for ; Mon, 9 Jan 2023 05:35:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C4C1B8E0001; Mon, 9 Jan 2023 00:35:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BD455900002; Mon, 9 Jan 2023 00:35:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A74D28E0006; Mon, 9 Jan 2023 00:35:01 -0500 (EST) 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 985668E0001 for ; Mon, 9 Jan 2023 00:35:01 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 5D5E71A0403 for ; Mon, 9 Jan 2023 05:35:01 +0000 (UTC) X-FDA: 80334146802.17.D7BFB80 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf30.hostedemail.com (Postfix) with ESMTP id CB2ED80009 for ; Mon, 9 Jan 2023 05:34:59 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="i/qCQROx"; spf=none (imf30.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=1673242500; 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=ka5+iF4ZHGa0/h4sTq7sbQGVl9e8Q3iYzmlIIaQ/sWI=; b=PMp17lzMIrXHgb9FLuvbKRbpZNqQctoMAc9Ho6nsnNFwvEHm+mAS6xJm+ZNcP1vfd1DcUQ KuZspgIc0MG82t7BVPtKrSgdIY74b6JuVXlyuZluKIhmPeeulX5TEdqE6M5GJ3M8rWfxL2 qdLeiQBGbAvhWADB9ilOHCULQf37odk= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="i/qCQROx"; spf=none (imf30.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=1673242500; a=rsa-sha256; cv=none; b=c5MNWIBfpI8U5nVJj9ZnytUbGa9Wja+5Nwqoigql72cEwgxzujFwbQ2UX+LaKZJYdwMM0Q UdFjxgou5RvQOVeJMxz6gxSjNJ/CTloZpOo5EV1v8wVKMxuAr9XlSnL2GOX61h2lyodtOK xLMiYkFEqtv5rRvqtqFVbnxjaqTU5Uc= 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)" To: 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-Stat-Signature: k9fzczkkztwot9zengqia7xcadjrowsq X-Rspam-User: X-Rspamd-Queue-Id: CB2ED80009 X-Rspamd-Server: rspam06 X-HE-Tag: 1673242499-948647 X-HE-Meta: U2FsdGVkX18S9tPIuHgCss4U9sRzkNC9WW2vBGpfJzGz4ZTYVQpdaEnalW9m0I5qq4132NOB1oLiH7OiKF1bGZb0QI6wrgRgIlphzIv/IkDqiD91jfS7lNOubsMAgLvmBv/BLpg3xRT60CRejmVKPJU0pYIKhxrfObHvMDwGjdPVK5mGh1YGTp8TyZ8qO3j7vqemRkoAx1tpzEBGx/p8PWDLHbgJwuWwA5wiuXhNHozGcCdzzobX4f39XkN/khpi4LN9+n43CDoTtKCDxSwq77KuBYPMA3dnklEQqXK3fBTAY5ZNd1iUt1E3fHpaO+BF0PuGx8ym8519R2BF0s657e+YvNCY/bxOPot0KKiAwL+gkNMnOooKIxXDSGw6ouocavfw4y38kQKerlDOFDWGtGQsC+Gqq5AlaK/9Y0J5J7qJPUhejl65LdAbG3TUvO9q34KDXYVAY1GlGZ+jBsnU/oWIPVTh7gCflzkogu3nwwHGkWZ2tWAJAMOJBEmZB5J1z+4mIot0F6pVF2Utj8KywGwiZKbWpszy0pRX60OgSOv1b2zzzsUSHuWeGc7XT1wBHKDlfs42S+95RYlrk700Rt2cQPwalYsMyRdxJ0ss0t7t/zXcwa7Jn0ntfQQetjxwsoKZEqTnp6Cp//k7PJ4B4NoF5/92fTMkjhdwlFtDkQFGT1AX35pa4Q8RH6BzjKYRLj6DOhinmhY+7XhntKKaurYQp//B+Q/CDw/8HM/9f9yMJhhg5LWE+4ivE+xy0y8lPuAnjewPMo4JDhqZF3ldtKzZHf1FT1ieUxhh+oYjDOrPc9B/OjVoBXvSD1NP3YdgQzhEeOuwEkOqsbnxZZzI7jNV5l1N0FI+Z5rrq6nUHFfXXEhgfU+N9ZvnKNTYRId/Wd04kekNJEgScG7LiT4IMrphoMlT50ipRDmQMlHTgPkDk6rYR4sTNg== 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: 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);