From patchwork Thu Apr 13 08:05:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 9678921 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 AC52A60381 for ; Thu, 13 Apr 2017 08:06:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DEA22861A for ; Thu, 13 Apr 2017 08:06:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 92CB128642; Thu, 13 Apr 2017 08:06:07 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, 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 3CEB32861A for ; Thu, 13 Apr 2017 08:06:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755022AbdDMIGG (ORCPT ); Thu, 13 Apr 2017 04:06:06 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:58488 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751528AbdDMIGE (ORCPT ); Thu, 13 Apr 2017 04:06:04 -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:To:From:Sender:Reply-To:Cc: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=16ONrwEmHjPDNEk8MxV5Kl4GjNGupc+gwhHx1SvVffE=; b=rlF1pR2ZL0gyRL5YjzLx66PgV hMc/afAUTnX/1XejSPaL0TEd9y5Thb2XbimKuaKOWtNGxq0vTUwB2RX08dBEvjxbVtspRuQ2hJeb0 1nBSz1/n1UrratLxcM2Mmx29Gt1PcsjT58MhJSxvUr2li24OMoZQVG/sXMXUUc3LpqgQd1VGJ11Be l1Bo1+9RXH+OJ/t7xxdi7agjA1LA05IctTm7d+vPNwtWwq96AoCsocwN1xSPq6tLDHj1jJOTewMra VldrSCHpSLB9hHThZ7x21U29hgHbLtnqmg6ke4RXc7e0Ta7xiUVMED39kND4XUyQ1jb4fk3NBm4AO +WFpo/XZQ==; Received: from 212095007060.public.telering.at ([212.95.7.60] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1cyZlS-0007es-Vx for linux-xfs@vger.kernel.org; Thu, 13 Apr 2017 08:06:03 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Subject: [PATCH 10/10] xfs: remove xfs_bmap_alloc Date: Thu, 13 Apr 2017 10:05:17 +0200 Message-Id: <20170413080517.12564-11-hch@lst.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170413080517.12564-1-hch@lst.de> References: <20170413080517.12564-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 Just opencode it in the only caller to make the code flow easier to follow. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster --- fs/xfs/libxfs/xfs_alloc.c | 2 +- fs/xfs/libxfs/xfs_bmap.c | 22 ++++++---------------- fs/xfs/libxfs/xfs_bmap.h | 2 +- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c index 7486401ccbd3..02326142ccb0 100644 --- a/fs/xfs/libxfs/xfs_alloc.c +++ b/fs/xfs/libxfs/xfs_alloc.c @@ -2606,7 +2606,7 @@ xfs_alloc_vextent( /* * Just fix this up, for the case where the last a.g. is shorter * (or there's only one a.g.) and the caller couldn't easily figure - * that out (xfs_bmap_alloc). + * that out (xfs_bmap_btalloc). */ agsize = mp->m_sb.sb_agblocks; if (args->maxlen > agsize) diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 9e3f0e6a9062..8e94030bcb8f 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -3842,20 +3842,6 @@ xfs_bmap_btalloc( return 0; } -/* - * xfs_bmap_alloc is called by xfs_bmapi to allocate an extent for a file. - * It figures out where to ask the underlying allocator to put the new extent. - */ -STATIC int -xfs_bmap_alloc( - struct xfs_bmalloca *ap) /* bmap alloc argument struct */ -{ - if (XFS_IS_REALTIME_INODE(ap->ip) && - xfs_alloc_is_userdata(ap->datatype)) - return xfs_bmap_rtalloc(ap); - return xfs_bmap_btalloc(ap); -} - /* Trim extent to fit a logical block range. */ void xfs_trim_extent( @@ -4273,7 +4259,11 @@ xfs_bmapi_allocate( return error; } - error = xfs_bmap_alloc(bma); + if (XFS_IS_REALTIME_INODE(bma->ip) && + xfs_alloc_is_userdata(bma->datatype)) + error = xfs_bmap_rtalloc(bma); + else + error = xfs_bmap_btalloc(bma); if (error) return error; @@ -4451,7 +4441,7 @@ xfs_bmapi_write( { struct xfs_mount *mp = ip->i_mount; struct xfs_ifork *ifp; - struct xfs_bmalloca bma = { NULL }; /* args for xfs_bmap_alloc */ + struct xfs_bmalloca bma = { NULL }; /* args for xfs_bmap_*alloc */ xfs_fileoff_t end; /* end of mapped file region */ bool eof = false; /* after the end of extents */ int error; /* error return */ diff --git a/fs/xfs/libxfs/xfs_bmap.h b/fs/xfs/libxfs/xfs_bmap.h index f35a2b2c4f06..6de7d321f8a2 100644 --- a/fs/xfs/libxfs/xfs_bmap.h +++ b/fs/xfs/libxfs/xfs_bmap.h @@ -28,7 +28,7 @@ struct xfs_trans; extern kmem_zone_t *xfs_bmap_free_item_zone; /* - * Argument structure for xfs_bmap_alloc. + * Argument structure for xfs_bmap_*alloc. */ struct xfs_bmalloca { xfs_fsblock_t *firstblock; /* i/o first block allocated */