From patchwork Thu Jan 11 21:14:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Gruenbacher X-Patchwork-Id: 10158589 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 81885605BA for ; Thu, 11 Jan 2018 21:15:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7447C2883D for ; Thu, 11 Jan 2018 21:15:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 69A7628859; Thu, 11 Jan 2018 21:15:46 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 187252883F for ; Thu, 11 Jan 2018 21:15:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932981AbeAKVPo (ORCPT ); Thu, 11 Jan 2018 16:15:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38506 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932290AbeAKVPo (ORCPT ); Thu, 11 Jan 2018 16:15:44 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6EAF76A7D8; Thu, 11 Jan 2018 21:15:39 +0000 (UTC) Received: from max.home.com (ovpn-117-99.ams2.redhat.com [10.36.117.99]) by smtp.corp.redhat.com (Postfix) with ESMTP id E7562851A; Thu, 11 Jan 2018 21:15:31 +0000 (UTC) From: Andreas Gruenbacher To: cluster-devel@redhat.com, Christoph Hellwig Cc: Andreas Gruenbacher , linux-fsdevel@vger.kernel.org Subject: [PATCH 05/10] gfs2: gfs2_stuffed_write_end cleanup (fixup) Date: Thu, 11 Jan 2018 22:14:59 +0100 Message-Id: <20180111211506.328-6-agruenba@redhat.com> In-Reply-To: <20180111211506.328-1-agruenba@redhat.com> References: <20180111211506.328-1-agruenba@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 11 Jan 2018 21:15:44 +0000 (UTC) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Revert "Third, make the page argument optional". --- fs/gfs2/aops.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index aa2031ff82c8..37410293c1f8 100644 --- a/fs/gfs2/aops.c +++ b/fs/gfs2/aops.c @@ -815,7 +815,7 @@ static void adjust_fs_space(struct inode *inode) * @dibh: The buffer_head containing the on-disk inode * @pos: The file position * @copied: How much was actually copied by the VFS - * @page: The (optional) page + * @page: The page * * This copies the data from the page into the inode block after * the inode data structure itself. @@ -830,29 +830,15 @@ static int gfs2_stuffed_write_end(struct inode *inode, struct buffer_head *dibh, u64 to = pos + copied; void *kaddr; unsigned char *buf = dibh->b_data + sizeof(struct gfs2_dinode); - bool page_grabbed = false; BUG_ON(pos + copied > gfs2_max_stuffed_size(ip)); - if (!page) { - page = find_lock_page(inode->i_mapping, 0); - if (WARN_ON(!page)) - return -ENOMEM; - page_grabbed = true; - } - kaddr = kmap_atomic(page); memcpy(buf + pos, kaddr + pos, copied); flush_dcache_page(page); kunmap_atomic(kaddr); WARN_ON(!PageUptodate(page)); - - if (page_grabbed) { - unlock_page(page); - put_page(page); - } - if (copied) { if (inode->i_size < to) i_size_write(inode, to);