From patchwork Wed May 9 07:48:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10388315 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 1D37D60170 for ; Wed, 9 May 2018 07:48:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D58628E05 for ; Wed, 9 May 2018 07:48:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0226D28E56; Wed, 9 May 2018 07:48:54 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7863928E05 for ; Wed, 9 May 2018 07:48:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933862AbeEIHsx (ORCPT ); Wed, 9 May 2018 03:48:53 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:51656 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933383AbeEIHsv (ORCPT ); Wed, 9 May 2018 03:48:51 -0400 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=xb7WGETnuSglw9LZ4UmlKDIRDpd70b+kw5sw3noLaec=; b=ux4+79VJdHDffyXZnKHexx13B YtLzWyuD/QUrJy86ZdRkypNOV63skbK1LBtHM1qmukMXlS+U/oIsmCYWIWGOozDvo05Qe+IMvFjgW CxSDiDGVVAh+k6caACyXHgA3F/+Sb5GiuesIzGiKibGcPXAhamUxGnT7lbQOfvR4vj97xnt0KdY88 QWhAS9hiPS7js2hhhuvqO+LVoBjNhYzLrk1j9S0W9jojRWYbZhDiqC+mLI06NkNf7Q/ZOeHIeC597 46XYee1ZiT7D1CKn14WlnuzIu35TRCX+Y/QsiouIxI97Y4JicFR127fYuxFlxYf6TfQ22yGDxtYej KUVjbDDzw==; Received: from 213-225-15-246.nat.highway.a1.net ([213.225.15.246] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fGJqE-00018o-Dd; Wed, 09 May 2018 07:48:50 +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/33] fs: remove the buffer_unwritten check in page_seek_hole_data Date: Wed, 9 May 2018 09:48:01 +0200 Message-Id: <20180509074830.16196-5-hch@lst.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180509074830.16196-1-hch@lst.de> References: <20180509074830.16196-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org 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 | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/fs/iomap.c b/fs/iomap.c index 13f518c7d3be..a739f3f995d9 100644 --- a/fs/iomap.c +++ b/fs/iomap.c @@ -610,14 +610,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;