From patchwork Thu Apr 13 08:05:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 9678917 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 479B560387 for ; Thu, 13 Apr 2017 08:06:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A8552861A for ; Thu, 13 Apr 2017 08:06:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2F71828642; Thu, 13 Apr 2017 08:06:05 +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 B088328652 for ; Thu, 13 Apr 2017 08:06:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754863AbdDMIGC (ORCPT ); Thu, 13 Apr 2017 04:06:02 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:38350 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751528AbdDMIFo (ORCPT ); Thu, 13 Apr 2017 04:05:44 -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=JDRs5KWcHfb4JK7iCIabOd/eLwDjhbEt0vOTwYQ/yQs=; b=Z+OkMmsubWylwtLp+T3gSSzoD BLStcKKjoUnxQ5e5X8+MilWskYYQnC0fdBVC+gWV9vRr2F7fmlMvVq1SHWUQTzakB4jax16PvpMUH NjfY+6k224YRReK9JT6rqZmX8QLKJ48Q8xU5oNCmOz1clT4F4olcsXr12WOY1Rwjf+ME81/wydvY9 mqiIn/c0xti2PYBzgqlXwERj19nbUwUTmrgQGup/iX5rqgj4Nb2cqm3dv+xxh1mnOFhR3RCeqqDJe AuaKJBpxYO2MiOI8QourUJBha0Fn8VgeskTofTFa7ayO1LFoEDZ6gsI5N73eWYC2I6dayqFyqM6Px WvIAkd2DQ==; 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 1cyZkz-0007Xy-2R for linux-xfs@vger.kernel.org; Thu, 13 Apr 2017 08:05:34 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Subject: [PATCH 03/10] xfs: remove the XFS_BMAPI_CONTIG flag Date: Thu, 13 Apr 2017 10:05:10 +0200 Message-Id: <20170413080517.12564-4-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 The only user just went away, so we can remove the flag and the minlen parameter in struct xfs_bmalloca now. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster --- fs/xfs/libxfs/xfs_bmap.c | 17 +++++++---------- fs/xfs/libxfs/xfs_bmap.h | 3 --- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 7f42f6067eb5..aec4907056ba 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -3473,12 +3473,12 @@ xfs_bmap_select_minlen( xfs_extlen_t *blen, int notinit) { - if (notinit || *blen < ap->minlen) { + if (notinit) { /* * Since we did a BUF_TRYLOCK above, it is possible that * there is space for this request. */ - args->minlen = ap->minlen; + args->minlen = 1; } else if (*blen < args->maxlen) { /* * If the best seen length is less than the request length, @@ -3670,11 +3670,11 @@ xfs_bmap_btalloc( args.type = XFS_ALLOCTYPE_FIRST_AG; else args.type = XFS_ALLOCTYPE_START_BNO; - args.total = args.minlen = ap->minlen; + args.total = args.minlen = 1; } else { args.type = XFS_ALLOCTYPE_NEAR_BNO; args.total = ap->total; - args.minlen = ap->minlen; + args.minlen = 1; } /* apply extent size hints if obtained earlier */ if (align) { @@ -3776,9 +3776,8 @@ xfs_bmap_btalloc( if ((error = xfs_alloc_vextent(&args))) return error; } - if (args.fsbno == NULLFSBLOCK && nullfb && - args.minlen > ap->minlen) { - args.minlen = ap->minlen; + if (args.fsbno == NULLFSBLOCK && nullfb && args.minlen > 1) { + args.minlen = 1; args.type = XFS_ALLOCTYPE_START_BNO; args.fsbno = ap->blkno; if ((error = xfs_alloc_vextent(&args))) @@ -3787,7 +3786,7 @@ xfs_bmap_btalloc( if (args.fsbno == NULLFSBLOCK && nullfb) { args.fsbno = 0; args.type = XFS_ALLOCTYPE_FIRST_AG; - args.total = ap->minlen; + args.total = 1; if ((error = xfs_alloc_vextent(&args))) return error; ap->dfops->dop_low = true; @@ -4246,8 +4245,6 @@ xfs_bmapi_allocate( bma->datatype |= XFS_ALLOC_USERDATA_ZERO; } - bma->minlen = (bma->flags & XFS_BMAPI_CONTIG) ? bma->length : 1; - /* * Only want to do the alignment at the eof if it is userdata and * allocation length is larger than a stripe unit. diff --git a/fs/xfs/libxfs/xfs_bmap.h b/fs/xfs/libxfs/xfs_bmap.h index a6e612cabe15..d9e0b1db4cdb 100644 --- a/fs/xfs/libxfs/xfs_bmap.h +++ b/fs/xfs/libxfs/xfs_bmap.h @@ -48,7 +48,6 @@ struct xfs_bmalloca { int logflags;/* flags for transaction logging */ xfs_extlen_t total; /* total blocks needed for xaction */ - xfs_extlen_t minlen; /* minimum allocation size (blocks) */ xfs_extlen_t minleft; /* amount must be left after alloc */ bool eof; /* set if allocating past last extent */ bool wasdel; /* replacing a delayed allocation */ @@ -81,7 +80,6 @@ struct xfs_extent_free_item #define XFS_BMAPI_PREALLOC 0x008 /* preallocation op: unwritten space */ #define XFS_BMAPI_IGSTATE 0x010 /* Ignore state - */ /* combine contig. space */ -#define XFS_BMAPI_CONTIG 0x020 /* must allocate only one extent */ /* * unwritten extent conversion - this needs write cache flushing and no additional * allocation alignments. When specified with XFS_BMAPI_PREALLOC it converts @@ -119,7 +117,6 @@ struct xfs_extent_free_item { XFS_BMAPI_ATTRFORK, "ATTRFORK" }, \ { XFS_BMAPI_PREALLOC, "PREALLOC" }, \ { XFS_BMAPI_IGSTATE, "IGSTATE" }, \ - { XFS_BMAPI_CONTIG, "CONTIG" }, \ { XFS_BMAPI_CONVERT, "CONVERT" }, \ { XFS_BMAPI_ZERO, "ZERO" }, \ { XFS_BMAPI_REMAP, "REMAP" }, \