From patchwork Fri May 18 16:48:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10411211 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 6CDE66031B for ; Fri, 18 May 2018 16:48:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E1B828619 for ; Fri, 18 May 2018 16:48:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 52F0A288E6; Fri, 18 May 2018 16:48:50 +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 E68F728619 for ; Fri, 18 May 2018 16:48:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 402096B05FF; Fri, 18 May 2018 12:48:47 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 385AB6B0600; Fri, 18 May 2018 12:48:47 -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 1DE3E6B0601; Fri, 18 May 2018 12:48:47 -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 C28426B0600 for ; Fri, 18 May 2018 12:48:46 -0400 (EDT) Received: by mail-pf0-f198.google.com with SMTP id w7-v6so5053674pfd.9 for ; Fri, 18 May 2018 09:48:46 -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=lS+wkpWI4Qnw2CGcPaVrAhIetLiXiN8ZHG0d8DAldu/7+oH3IVjEHHvz78f2S2Ac7j wydutH19A1QptR/G/jokSxv3IC9KUTAk0Zq1GkLnzJHn7ZjZuojpDTY1rsl1AVUAvm0/ f7PNng7liEgIwmMCyqdojkn3D72M/nDsVLhexWfy20v1oGglTmXNjAU5n8ilBMvoWxxF o9/WEqz2L+41QVj6WDBuWWhK78qKDGGFZH54kAW1n6q19pxLv7VyhsX21YPO4SJhH2hi 3gG0TErTbYljZjlgrXJOcHxUg6f03eF13t+Dw63F6lJFmEM9UbSQRTfogxLh5E5VgvAX KbIA== X-Gm-Message-State: ALKqPwcVx2HK72lBurM/iF3PSvMyFh3UI97HfvJ6d1btEHTtMDJc+Tyh c/SZqk/pKsBxM/W0/P1AdbvN8ZBsB09p3PQvZxYPEVGyEvwF4wXBJvjJZQNAB/zuaViX+fcTHPm nxL/kw3gXVeSszxusHezKvZzZCfZRZCn89cG7OjAieu7mU+4/dGDx08u09YL7/7o= X-Received: by 2002:a62:de02:: with SMTP id h2-v6mr10162528pfg.205.1526662126464; Fri, 18 May 2018 09:48:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoSD4SNVpJjYNvlFizhJFvo6bdyifW4ctGbd/z7Ye39tllnhU0hcvUVdiH0IcUU/DnDyYAh X-Received: by 2002:a62:de02:: with SMTP id h2-v6mr10162494pfg.205.1526662125756; Fri, 18 May 2018 09:48:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526662125; cv=none; d=google.com; s=arc-20160816; b=lnGX2XwdKHHIJ5Z/9dnDNl1H2VGi2l7uMwRH3PPtvxtyDA5mpQxKJbR/mfumEAAz1w CgPTgGOK/3F4+yZohw/hNtUaYjtoyTC0XTbvWIdtaH48GusB2431BlQwX88u6BP7NUmj oYp053tFpqifVYO5x0o995bvTWor5NioVNxMWxkRIBQdVNdGmCwVj+RmMWCm08SoGT4y kw+9aH191Hea2teZGD7Y1kR2tSHM5Fe7KQEhE+gAmwEmetmZeYvHWGxe7ek9S42I6kKM Azoko11b/CzZZvy81CYG1/Fj3H6lXl0wQfAzf8G1UMy6VTQXq+s3wvOQ/JB/6FU3zXiK fU2A== 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=FALZqFnxqkfgRpcoYePP/9ePbGLP7Ndwmm8RskjwCS0M6oMtJ4ENN4QqHzWjnqS7PW 3/2OTmAQ9BozjNrD1IcHFVolHB664QA+gueQ+NJQxjHxf8yK1pT5SlBUbOiIOGJNJ0jc K+pi0UuROzdE2stwaHDRV34t5TpUpor3nJfN/nkq46whP/JDAGfbrGjqOYMi9B8leHiw sVO0+di0b17h6gYA6+7REik7hfIIaiQ2flTThbfg3r3BFy2ZlVcQwwXjmInA73v57dY9 gUNbR9/zxjU06WC5fLUSpBFhDOcjDIeT4jM3RwzUrlueGJ/3FjaSg6IlugzUjHSGFKEO o+sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=CU8nxNFj; spf=pass (google.com: best guess record for domain of batv+77ddf8e9b1b344f28472+5381+infradead.org+hch@bombadil.srs.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=BATV+77ddf8e9b1b344f28472+5381+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 s6-v6si6461946pgr.369.2018.05.18.09.48.45 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 May 2018 09:48:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of batv+77ddf8e9b1b344f28472+5381+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=CU8nxNFj; spf=pass (google.com: best guess record for domain of batv+77ddf8e9b1b344f28472+5381+infradead.org+hch@bombadil.srs.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=BATV+77ddf8e9b1b344f28472+5381+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=CU8nxNFjHBZ8TuMHIZtt3jnnn GQr8Z4SOIMBPc+SK8g337UfgEfQ3k0mJnCIsSFhbmra9EaFK9kJb+PYw6jwXGPiUFQEa5HXfhIeqN dkl11xRTlDViS62MOxXUNNlg3eQGtY5CLzEQb74YRFrQTmsOul0AhzNmVvMa7SmjIivrke1NcTEGg 6U8TLPRiEIpSlwbflRWKSEOYtXqNF2bdU6eIUC2DCx9txcaKQHDkvOjpU7BCja8ke3uO/Qrj7JwLL bJNvTOSCU4UzHsXeR1XKJPMedl7qLY+D/4nu2m2tYH8obw140QiFFlTR6cLV46tx9kldHSk/mY9Lh Qd5gYUdcA==; Received: from 80-109-164-210.cable.dynamic.surfer.at ([80.109.164.210] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJiYe-0006Sa-Sg; Fri, 18 May 2018 16:48:45 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 04/34] fs: remove the buffer_unwritten check in page_seek_hole_data Date: Fri, 18 May 2018 18:48:00 +0200 Message-Id: <20180518164830.1552-5-hch@lst.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180518164830.1552-1-hch@lst.de> References: <20180518164830.1552-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 --- 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. */