From patchwork Wed May 9 07:48:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10388537 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 9B14060170 for ; Wed, 9 May 2018 07:50:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8CFCE28E56 for ; Wed, 9 May 2018 07:50:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 810B428E65; Wed, 9 May 2018 07:50:53 +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=unavailable 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 0B1F828E68 for ; Wed, 9 May 2018 07:50:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DF8BF6B0380; Wed, 9 May 2018 03:50:45 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id D5A0A6B0383; Wed, 9 May 2018 03:50:45 -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 B5D0D6B0384; Wed, 9 May 2018 03:50:45 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl0-f70.google.com (mail-pl0-f70.google.com [209.85.160.70]) by kanga.kvack.org (Postfix) with ESMTP id 6FD076B0380 for ; Wed, 9 May 2018 03:50:45 -0400 (EDT) Received: by mail-pl0-f70.google.com with SMTP id h32-v6so3306662pld.15 for ; Wed, 09 May 2018 00:50:45 -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=fFTBV5Obl8n03uogE5L7HLiBMTdVozVH/rnXorrYaRo=; b=RnKQxnNQ06EpA0ETjNRUbO8zYKaoqh9mpomgu3tIx5Uh4SLSn3pk6bBYg1oyOwjlbg BaltjdVAhkssg0fKhyEWe6KhTbR1T7vbL3eOQGCxLukvMzBOY9CMQW/9YJeLrH8epOTb 9CPGElwXDlJ/KgueF9yoDl7/Y0nhi9TY9TVSUI+ufOR1YxyDcS/nTXFji4VU7w39JU9C be1tZEY8mw10FZc5BzcMb669XNNfGf9T34l0wIHtgJHwSTY6ceJSCDJ5WGkzl3qwbpwH SxiLcYDPVMLisv7osuuKkaxUykWMbzR2Hz5xNff2ZIRRBQQdfrqXs/pYU1x+lMfy319s l2sg== X-Gm-Message-State: ALQs6tAlgQeHxz1WODGtsr17Q+WpwuHcDpDTfn9E4RG0nnYpAy23XpWM F8CjXE2wt5rS19ETYKhuTCPJ6FpooxBmxW1SIWbBN5AC+AsrBNJnlsik/8vCAbtt047q7q+rE/8 Yt6b8YqWR+4AWVTOFF+JU0VtjubkKeIUQpgSMRPbz15FCZ7PXLx/nthh0y5mshjQ= X-Received: by 2002:a63:7150:: with SMTP id b16-v6mr35082207pgn.326.1525852245129; Wed, 09 May 2018 00:50:45 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoAu2GOWgmZ40qOVTw1oC7iwRvzcZBxyhLMaKhqmmI0Yx5sCl8Yi8gQ4I+b8VSlqwTOJQLM X-Received: by 2002:a63:7150:: with SMTP id b16-v6mr35082184pgn.326.1525852244381; Wed, 09 May 2018 00:50:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525852244; cv=none; d=google.com; s=arc-20160816; b=lEhIr/3eKTV9g40TlzbWZXQeyjdght8Zjto+wmAlaTZMyGYGVN24+GKMSIKEmcEkv7 R0Qru4UTht7YCERk3FeYTicvC3m4m/CTddlsq/IrCqpaUXMklBxcKbSf4R6np61p8q54 D6VzIEBHAOsZjLQBqYSgpq2fGBnGRKqH9wSr3yvMaD2hL6IsU6NvHdStNniJPNkpecAX EEBPcgku9CIIummArErW15umTjHAUbKCCSx9OyQ2B0CmTkiuMNzw1Qe2Q2ecZTpAUncn NDqghrChLHRom5bMiJVUzRRu8VKqJkmOSRxEPh8iWpZWyBSe6ivRbobaXDzuWEWhq+19 ix+g== 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=fFTBV5Obl8n03uogE5L7HLiBMTdVozVH/rnXorrYaRo=; b=FENK22nuerKO2sD59a4Fz8rAlSXEhO3QyRLBLI3xkjtWwgS7lK1KFC8c8RJXhxv+zI tteO4TIBdLw+YcAD7OhPQrPWr13k3YaFVkEMRvO4LeWSF/b5SNyqtuoQea5t7QCCmaw4 BaVo3ZMcGJ+BIohvQGECDEPmXBfxXPqPa6QYxbll6CJm3IFZK7sOqYj3FN3b2I1HG7QF 6pzN9YI/tkozMKS7/FWRPxrOe79rw4zUi0f0x49uGdp6oUljghr3FpG4LyrtrmBqVgkI 8H824C1W5udkXl8AH7wCvvi4wu7GsXxNHcEN1Cq0l/sIUuCthcardnnoWA0kBP0GAJTI NOCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=ZkGcSQ6R; spf=pass (google.com: best guess record for domain of batv+e0efdd19ce80d487e3da+5372+infradead.org+hch@bombadil.srs.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=BATV+e0efdd19ce80d487e3da+5372+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 h64-v6si21294976pge.206.2018.05.09.00.50.44 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 May 2018 00:50:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of batv+e0efdd19ce80d487e3da+5372+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=ZkGcSQ6R; spf=pass (google.com: best guess record for domain of batv+e0efdd19ce80d487e3da+5372+infradead.org+hch@bombadil.srs.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=BATV+e0efdd19ce80d487e3da+5372+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=fFTBV5Obl8n03uogE5L7HLiBMTdVozVH/rnXorrYaRo=; b=ZkGcSQ6R9P7GILzDiYdaawuf6 T+Z7kDTBUgHJp4H2XzCVn59a4R5YXNSEE+6siIf46tuax1GvGQb1IEo6dtNsSsT8EiMj4zyRYkBWV jMoX8Hxl8nyMr0HymDXJBkjXP2g2vVGom6zXZTaNJjc2e6WrV3erqI5tdQL322xGMvsbLBWw4Gj/P x0FyROZKNKTDwED6clxyJRkpz6gZKxNOhhXQpX5mSGpPYhlYjtEwxC3a9kgiKqj1n1pLmZAySWhBY zAPZOSYt3FxoFtplfpVgwev7WHKsnWiFv4f8aAsbcUYulmg54gE6CxtnOE79LuXlo0bRW8upxDFMT ollVbSmRA==; 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 1fGJs3-0003RH-6m; Wed, 09 May 2018 07:50:43 +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 33/33] fs: remove __block_write_begin and iomap_to_bh Date: Wed, 9 May 2018 09:48:30 +0200 Message-Id: <20180509074830.16196-34-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 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 Now that the iomap buffered write code stopped using bufferheads these aren't used anymore. Signed-off-by: Christoph Hellwig --- fs/buffer.c | 76 ++++----------------------------------------------- fs/internal.h | 2 -- 2 files changed, 5 insertions(+), 73 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index 71ea9a29e9d5..5cdcaa6230ed 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -1863,62 +1862,8 @@ void page_zero_new_buffers(struct page *page, unsigned from, unsigned to) } EXPORT_SYMBOL(page_zero_new_buffers); -static void -iomap_to_bh(struct inode *inode, sector_t block, struct buffer_head *bh, - struct iomap *iomap) -{ - loff_t offset = block << inode->i_blkbits; - - bh->b_bdev = iomap->bdev; - - /* - * Block points to offset in file we need to map, iomap contains - * the offset at which the map starts. If the map ends before the - * current block, then do not map the buffer and let the caller - * handle it. - */ - BUG_ON(offset >= iomap->offset + iomap->length); - - switch (iomap->type) { - case IOMAP_HOLE: - /* - * If the buffer is not up to date or beyond the current EOF, - * we need to mark it as new to ensure sub-block zeroing is - * executed if necessary. - */ - if (!buffer_uptodate(bh) || - (offset >= i_size_read(inode))) - set_buffer_new(bh); - break; - case IOMAP_DELALLOC: - if (!buffer_uptodate(bh) || - (offset >= i_size_read(inode))) - set_buffer_new(bh); - set_buffer_uptodate(bh); - set_buffer_mapped(bh); - set_buffer_delay(bh); - break; - case IOMAP_UNWRITTEN: - /* - * For unwritten regions, we always need to ensure that - * sub-block writes cause the regions in the block we are not - * writing to are zeroed. Set the buffer as new to ensure this. - */ - set_buffer_new(bh); - set_buffer_unwritten(bh); - /* FALLTHRU */ - case IOMAP_MAPPED: - if (offset >= i_size_read(inode)) - set_buffer_new(bh); - bh->b_blocknr = (iomap->addr + offset - iomap->offset) >> - inode->i_blkbits; - set_buffer_mapped(bh); - break; - } -} - -int __block_write_begin_int(struct page *page, loff_t pos, unsigned len, - get_block_t *get_block, struct iomap *iomap) +int __block_write_begin(struct page *page, loff_t pos, unsigned len, + get_block_t *get_block) { unsigned from = pos & (PAGE_SIZE - 1); unsigned to = from + len; @@ -1954,14 +1899,9 @@ int __block_write_begin_int(struct page *page, loff_t pos, unsigned len, clear_buffer_new(bh); if (!buffer_mapped(bh)) { WARN_ON(bh->b_size != blocksize); - if (get_block) { - err = get_block(inode, block, bh, 1); - if (err) - break; - } else { - iomap_to_bh(inode, block, bh, iomap); - } - + err = get_block(inode, block, bh, 1); + if (err) + break; if (buffer_new(bh)) { clean_bdev_bh_alias(bh); if (PageUptodate(page)) { @@ -2001,12 +1941,6 @@ int __block_write_begin_int(struct page *page, loff_t pos, unsigned len, page_zero_new_buffers(page, from, to); return err; } - -int __block_write_begin(struct page *page, loff_t pos, unsigned len, - get_block_t *get_block) -{ - return __block_write_begin_int(page, pos, len, get_block, NULL); -} EXPORT_SYMBOL(__block_write_begin); static int __block_commit_write(struct inode *inode, struct page *page, diff --git a/fs/internal.h b/fs/internal.h index b955232d3d49..47764f739075 100644 --- a/fs/internal.h +++ b/fs/internal.h @@ -41,8 +41,6 @@ static inline int __sync_blockdev(struct block_device *bdev, int wait) * buffer.c */ extern void guard_bio_eod(int rw, struct bio *bio); -extern int __block_write_begin_int(struct page *page, loff_t pos, unsigned len, - get_block_t *get_block, struct iomap *iomap); int __generic_write_end(struct inode *inode, loff_t pos, unsigned copied, struct page *page);