From patchwork Wed May 23 14:43:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10421473 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 41CA76032A for ; Wed, 23 May 2018 14:44:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 327DC223A4 for ; Wed, 23 May 2018 14:44:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 25EC928733; Wed, 23 May 2018 14:44:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85D9C223A4 for ; Wed, 23 May 2018 14:44:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 232CC6B0010; Wed, 23 May 2018 10:44:17 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 1BB286B0269; Wed, 23 May 2018 10:44:17 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0A9DE6B026A; Wed, 23 May 2018 10:44:17 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf0-f198.google.com (mail-pf0-f198.google.com [209.85.192.198]) by kanga.kvack.org (Postfix) with ESMTP id BF9B86B0010 for ; Wed, 23 May 2018 10:44:16 -0400 (EDT) Received: by mail-pf0-f198.google.com with SMTP id p189-v6so13286320pfp.2 for ; Wed, 23 May 2018 07:44:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references; bh=IM1dB5osyQ6t1GqMngnEN76HG/BPytJpas8Qsm2h8G0=; b=ZRsExmhxCWcVKMgviFdqO1vYtp73OPqaecQbTIQzTaIUaLLE8kojgVre/MI+XPaU7g n4VTCMg363Cre7aVm7YJUTu+kzlOELi7d9t+9H3YtmDS+thH4SufKB7usURU/smdRocm DRDgiEHBWNNvqN3ZRLJHHmaBwkG06b8yTKScCJDl7YZVT8z+v/jY7FVzq6/qjWJ2j997 d+zoXMvjC+ybOj4iYlaHVPAJQQD5CtNmRymrA2mF4VqS2Ees5jagMzBZHWyG6XEQuhKC 7ks5r6/9cAdOfgOEzlwqB1zYHplMC2+bSKh8LKDLZBn5/DzwfqLkROsvRJK/HUwT+bPf PZkQ== X-Gm-Message-State: ALKqPwdDTqSlCTZn6ruTk/FystNjc49YLZnSQZve74pP3S6Zw9XFT+eD o5DdD/qKIN+FTYOEexd3FzCkYgctWu8G1cqB0pNvqt7FHHxUA29p9YE01OBMPMuyP6HhiK43gYK YrOdDYLHVCueOwd7fo3HVjwJ7xrfBxBTYegG+6sewi1sRVy6fcGptwYTnvzu2qdk= X-Received: by 2002:a17:902:683:: with SMTP id 3-v6mr3270508plh.291.1527086656487; Wed, 23 May 2018 07:44:16 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrprYqb3TV3NctNEqAObFE7FRfXBP/KG3dFbUIMHKEME37jWAeMoOncmVxvTNi8B/e7gnmh X-Received: by 2002:a17:902:683:: with SMTP id 3-v6mr3270471plh.291.1527086655814; Wed, 23 May 2018 07:44:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527086655; cv=none; d=google.com; s=arc-20160816; b=LJdQxVzL5Gs4AAgvUmX4nsYkCgeVLVsEMIw5Z9ARttKTsVJ745Ru/JUt0P/kOHQ46O XbLt7b7pEtBIymim9K/DJv6bf0CRk8fcIQa18GxyjReo+FiVoOmkMHDCUfMzb1h2mV6V pnEZyWAoo16+zc8JCXUk4CoIzNlGrXr10aKc70yVSrp2kBwuVosM8Ozg+8aVG6DTvWna WYD06ms/V771tOIJ2Rj6UW914GJQOXBTQL8yDaiEI1b4DyavxhCWrGPq56mfahwdyDj0 +uV9UcNZsznHBhUcNHm8Phze3Gsk3h8IL/5Dvu/i0TeMBYmfJ5oChgf2NtItnmhz0pJb e95Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=IM1dB5osyQ6t1GqMngnEN76HG/BPytJpas8Qsm2h8G0=; b=p0BZkMLNUhv77fF+r4RaoQK5qOd2vhow/IWmeGuk2iKm6wtscMW5DWxl4HSRJ0Chq1 E7uypfVjTZDAlNzC0l0W5+EIX7gbGZHGvlfSWaP0ROP9FOxPvvwdWvb7VTb4m3jJDrLL GgrwlAE6jx8FYz7SYyEcKpxoc/Obge7pspPqpL62nmCAYRmDaXJRZgQ1miPRuifmR4PR zaduXgJgES/4923GFBw60qogJr/x+4NX5ZHZ7GnL9jocIa07wz1Ove0Zg2bZSEBCLJQF sxnvW3+f0wcPOECVJMeskNM93JMUH/icKgvAZmkDTh6HBx3DVGQMIyLxoWDIMk2wcEtc SArw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=ewCxMLTL; spf=pass (google.com: best guess record for domain of batv+df5a2477ff0fa86e9985+5386+infradead.org+hch@bombadil.srs.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=BATV+df5a2477ff0fa86e9985+5386+infradead.org+hch@bombadil.srs.infradead.org Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id t127-v6si14470644pgc.519.2018.05.23.07.44.15 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 May 2018 07:44:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of batv+df5a2477ff0fa86e9985+5386+infradead.org+hch@bombadil.srs.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=ewCxMLTL; spf=pass (google.com: best guess record for domain of batv+df5a2477ff0fa86e9985+5386+infradead.org+hch@bombadil.srs.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=BATV+df5a2477ff0fa86e9985+5386+infradead.org+hch@bombadil.srs.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=IM1dB5osyQ6t1GqMngnEN76HG/BPytJpas8Qsm2h8G0=; b=ewCxMLTLflCdVAQGtHToWQ70d vEZqLo8txEQzdn5tMJ0/uQM3TNA50UU1Hyx4yHTGNWsHd8wfkFzQrYqo6j6P+r6++wunlpPsot1PV +OnFd95Du+6T2DhnI0eW5oahEdg54IrZFpecbnbTK5RbGIodIxg+DYLCKSCW09AWmt18TW1siHMAp lkRp3TUhF3pBMfeKQlPLCEl/6F3yuM109fXnrA+tYbGIHJ8NNYIBVMmb/jT35s9pTIBjk1Vx185ST T0u8dXa3XkS6HPDmP09cNU37qIqr20xgx9JGSp3AZekSOwW9IDllbuE/FcUJcP6JLMEXw2HaWfblE y1K8+KlMw==; Received: from 089144199016.atnat0008.highway.a1.net ([89.144.199.16] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fLUzt-0000C5-HO; Wed, 23 May 2018 14:44:13 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 04/34] fs: remove the buffer_unwritten check in page_seek_hole_data Date: Wed, 23 May 2018 16:43:27 +0200 Message-Id: <20180523144357.18985-5-hch@lst.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180523144357.18985-1-hch@lst.de> References: <20180523144357.18985-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html 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: X-Virus-Scanned: ClamAV using ClamSMTP We only call into this function through the iomap iterators, so we already know the buffer is unwritten. In addition to that we always require the uptodate flag that is ORed with the result anyway. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- fs/iomap.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/fs/iomap.c b/fs/iomap.c index 4a01d2f4e8e9..bef5e91d40bf 100644 --- a/fs/iomap.c +++ b/fs/iomap.c @@ -611,14 +611,9 @@ page_seek_hole_data(struct page *page, loff_t lastoff, int whence) continue; /* - * Unwritten extents that have data in the page cache covering - * them can be identified by the BH_Unwritten state flag. - * Pages with multiple buffers might have a mix of holes, data - * and unwritten extents - any buffer with valid data in it - * should have BH_Uptodate flag set on it. + * Any buffer with valid data in it should have BH_Uptodate set. */ - - if ((buffer_unwritten(bh) || buffer_uptodate(bh)) == seek_data) + if (buffer_uptodate(bh) == seek_data) return lastoff; lastoff = offset; @@ -630,8 +625,8 @@ page_seek_hole_data(struct page *page, loff_t lastoff, int whence) * Seek for SEEK_DATA / SEEK_HOLE in the page cache. * * Within unwritten extents, the page cache determines which parts are holes - * and which are data: unwritten and uptodate buffer heads count as data; - * everything else counts as a hole. + * and which are data: uptodate buffer heads count as data; everything else + * counts as a hole. * * Returns the resulting offset on successs, and -ENOENT otherwise. */