From patchwork Fri Nov 3 14:45:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10040441 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 2A0956032D for ; Fri, 3 Nov 2017 14:46:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D13B29680 for ; Fri, 3 Nov 2017 14:46:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0EFA32968C; Fri, 3 Nov 2017 14:46:12 +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 7C95729680 for ; Fri, 3 Nov 2017 14:46:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933182AbdKCOqJ (ORCPT ); Fri, 3 Nov 2017 10:46:09 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:35621 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752966AbdKCOqI (ORCPT ); Fri, 3 Nov 2017 10:46:08 -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=TU5x/g7F91QT5SeGrhdRax6SE4V+BdFSUF8Dol5tFZo=; b=BLEdJkJuYc8FGONI9VKTe754o Kt7ENdXDGDuslWQD9OYWg0E44sVjY9YML40NTXHwq6ulBHBh0+vkOq4cCP1gTUTFrH+cj4/3SRXa0 rSUqZA9F1Iyx1VKeXF5QAELvEGaSuvH2KuHiWIGNeLMx6mWdma7kbG6eFvK8VzqKcEfjq9GM6iTgc WSgW/GqOkZaa1e4QbRG+RFYcs9FdSMjx0xd4HYqFeKIuJ0PKZfSMw5Wnu/X+CoXI6/5qNqWjYe5HN abG12ux5zTYEGCFMHGvXp9NNMwyj5335dX+CnPQmfF6Ur9dOIn7PZiGVIJMfUfocM9DLZtKi+0Lqh JVmnCx6PQ==; Received: from [94.72.11.11] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1eAdEV-0001sX-Qx for linux-xfs@vger.kernel.org; Fri, 03 Nov 2017 14:46:08 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Subject: [PATCH 07/21] xfs: treat idx as a cursor in xfs_bmap_del_extent_* Date: Fri, 3 Nov 2017 17:45:25 +0300 Message-Id: <20171103144539.2187-8-hch@lst.de> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171103144539.2187-1-hch@lst.de> References: <20171103144539.2187-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 Stop poking before and after the index and just increment or decrement it while doing our operations on it to prepare for a new extent list implementation. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong --- fs/xfs/libxfs/xfs_bmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 3667fb1f3961..f64b6b74daa9 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -4750,12 +4750,12 @@ xfs_bmap_del_extent_delay( del->br_blockcount); got->br_startblock = nullstartblock((int)got_indlen); - xfs_iext_update_extent(ip, state, *idx, got); new.br_startoff = del_endoff; new.br_state = got->br_state; new.br_startblock = nullstartblock((int)new_indlen); + xfs_iext_update_extent(ip, state, *idx, got); ++*idx; xfs_iext_insert(ip, *idx, 1, &new, state); @@ -4832,13 +4832,13 @@ xfs_bmap_del_extent_cow( * Deleting the middle of the extent. */ got->br_blockcount = del->br_startoff - got->br_startoff; - xfs_iext_update_extent(ip, state, *idx, got); new.br_startoff = del_endoff; new.br_blockcount = got_endoff - del_endoff; new.br_state = got->br_state; new.br_startblock = del->br_startblock + del->br_blockcount; + xfs_iext_update_extent(ip, state, *idx, got); ++*idx; xfs_iext_insert(ip, *idx, 1, &new, state); break; @@ -5054,8 +5054,8 @@ xfs_bmap_del_extent_real( flags |= xfs_ilog_fext(whichfork); XFS_IFORK_NEXT_SET(ip, whichfork, XFS_IFORK_NEXTENTS(ip, whichfork) + 1); - xfs_iext_insert(ip, *idx + 1, 1, &new, state); ++*idx; + xfs_iext_insert(ip, *idx, 1, &new, state); break; }