diff options
| author | Darrick J. Wong <darrick.wong@oracle.com> | 2013-12-15 23:50:52 -0500 |
|---|---|---|
| committer | Theodore Ts'o <tytso@mit.edu> | 2013-12-15 23:50:54 -0500 |
| commit | 230272c15a71edfd53bc805adf560d0386dddff3 (patch) | |
| tree | 63ae4fde35e8fe172ae537f567f720a8e44cda22 /lib/ext2fs | |
| parent | 84397754250d13e8596dd68c157c4c9863800079 (diff) | |
| download | android_external_e2fsprogs-230272c15a71edfd53bc805adf560d0386dddff3.tar.gz android_external_e2fsprogs-230272c15a71edfd53bc805adf560d0386dddff3.tar.bz2 android_external_e2fsprogs-230272c15a71edfd53bc805adf560d0386dddff3.zip | |
libext2fs: don't update the summary counts when doing implied cluster allocation
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.
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'lib/ext2fs')
| -rw-r--r-- | lib/ext2fs/expanddir.c | 2 | ||||
| -rw-r--r-- | lib/ext2fs/mkjournal.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/ext2fs/expanddir.c b/lib/ext2fs/expanddir.c index 41c40882..153b838c 100644 --- a/lib/ext2fs/expanddir.c +++ b/lib/ext2fs/expanddir.c @@ -54,6 +54,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); @@ -80,7 +81,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 69ac1350..d09c4589 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); |
