mirror of
https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
synced 2024-11-25 02:53:52 +08:00
d2bfdc7ff1
If e2fsprogs tools (mke2fs, e2fsck) is run on regular file instead of on block device, we can use punch hole instead of regular discard command which would not work on regular file anyway. This gives us several advantages. First of all when e2fsck is run with '-E discard' parameter it will punch out all ununsed space from the image, hence trimming down the file system image. And secondly, when creating an file system on regular file (with '-E discard' which is default), we can use punch hole to clear the file content, hence we can skip inode table initialization, because reads from sparse area returns zeros. This will result in faster file system creation (without the need to specify lazy_itable_init) and smaller images. This commit also fixes some tests that would fail due to mke2fs showing discard progress, hence the output would differ. Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
25 lines
798 B
Plaintext
25 lines
798 B
Plaintext
if test -x $DEBUGFS_EXE; then
|
|
|
|
if [ "$FS_SIZE"x = x ]; then
|
|
FS_SIZE=1024
|
|
fi
|
|
OUT1=$test_name.1.log
|
|
OUT2=$test_name.2.log
|
|
SKIP_GUNZIP=true
|
|
ONE_PASS_ONLY=true
|
|
MKE2FS_SKIP_PROGRESS=true
|
|
MKE2FS_SKIP_CHECK_MSG=true
|
|
export MKE2FS_SKIP_PROGRESS MKE2FS_SKIP_CHECK_MSG
|
|
> $TMPFILE
|
|
PREP_CMD='$MKE2FS -F -o Linux $MKE2FS_OPTS $TMPFILE $FS_SIZE 2>&1 | sed -e 1d | grep -v "Discarding device blocks" | tr -d \\015 > $OUT1 ; $DEBUGFS -R features $TMPFILE 2>&1 | sed -e 1d | tr -d \\015 >> $OUT1 ; echo " " >> $OUT1'
|
|
AFTER_CMD='$DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter_dumpe2fs | tr -d \\015 >> $OUT1'
|
|
. $cmd_dir/run_e2fsck
|
|
|
|
else #if test -x $DEBUGFS_EXE; then
|
|
rm -f $test_name.ok $test_name.failed
|
|
echo "skipped"
|
|
fi
|
|
|
|
unset DESCRIPTION FS_SIZE MKE2FS_OPTS MKE2FS_SKIP_PROGRESS \
|
|
MKE2FS_DEVICE_SECTSIZE
|