From patchwork Tue Oct 1 01:29:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darrick Wong X-Patchwork-Id: 279302 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 226192C00AB for ; Tue, 1 Oct 2013 11:29:14 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755558Ab3JAB3N (ORCPT ); Mon, 30 Sep 2013 21:29:13 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:38071 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755105Ab3JAB3N (ORCPT ); Mon, 30 Sep 2013 21:29:13 -0400 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r911TB4u023817 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 1 Oct 2013 01:29:11 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r911TAqm004957 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 1 Oct 2013 01:29:10 GMT Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r911TA5P004951; Tue, 1 Oct 2013 01:29:10 GMT Received: from localhost (/10.137.226.112) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 30 Sep 2013 18:29:10 -0700 Subject: [PATCH 23/31] libext2fs: expanddir and mkjournal need not update the summary counts when performing an implied cluster allocation To: tytso@mit.edu, darrick.wong@oracle.com From: "Darrick J. Wong" Cc: linux-ext4@vger.kernel.org Date: Mon, 30 Sep 2013 18:29:09 -0700 Message-ID: <20131001012909.28415.3283.stgit@birch.djwong.org> In-Reply-To: <20131001012642.28415.89353.stgit@birch.djwong.org> References: <20131001012642.28415.89353.stgit@birch.djwong.org> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Source-IP: acsinet21.oracle.com [141.146.126.237] Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org When we're appending a block to a directory file or the journal file, and the new block is part of a cluster that has already been allocated to the file (implied cluster allocation), don't update the bitmap or the summary counts because that was performed when the cluster was allocated. Signed-off-by: Darrick J. Wong Reviewed-by: Lukas Czerner --- lib/ext2fs/expanddir.c | 2 +- lib/ext2fs/mkjournal.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/lib/ext2fs/expanddir.c b/lib/ext2fs/expanddir.c index 22558d6..09a15fa 100644 --- a/lib/ext2fs/expanddir.c +++ b/lib/ext2fs/expanddir.c @@ -55,6 +55,7 @@ static int expand_dir_proc(ext2_filsys fs, return BLOCK_ABORT; } es->newblocks++; + ext2fs_block_alloc_stats2(fs, new_blk, +1); } if (blockcnt > 0) { retval = ext2fs_new_dir_block(fs, 0, 0, &block); @@ -82,7 +83,6 @@ static int expand_dir_proc(ext2_filsys fs, } ext2fs_free_mem(&block); *blocknr = new_blk; - ext2fs_block_alloc_stats2(fs, new_blk, +1); if (es->done) return (BLOCK_CHANGED | BLOCK_ABORT); diff --git a/lib/ext2fs/mkjournal.c b/lib/ext2fs/mkjournal.c index c636a97..dd3c35b 100644 --- a/lib/ext2fs/mkjournal.c +++ b/lib/ext2fs/mkjournal.c @@ -250,6 +250,7 @@ static int mkjournal_proc(ext2_filsys fs, es->err = retval; return BLOCK_ABORT; } + ext2fs_block_alloc_stats2(fs, new_blk, +1); es->newblocks++; } if (blockcnt >= 0) @@ -285,7 +286,6 @@ static int mkjournal_proc(ext2_filsys fs, return BLOCK_ABORT; } *blocknr = es->goal = new_blk; - ext2fs_block_alloc_stats2(fs, new_blk, +1); if (es->num_blocks == 0) return (BLOCK_CHANGED | BLOCK_ABORT);