Whamcloud - gitweb
e2fsck: Discard free data and inode blocks.
authorLukas Czerner <lczerner@redhat.com>
Thu, 18 Nov 2010 03:38:38 +0000 (03:38 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 23 Nov 2010 02:01:41 +0000 (21:01 -0500)
commitefa1a355a1e4142b2d057be06931eb8fc0903ba3
tree1d9353dd8075d7494f6b0d435cd2e3452b08a9a9
parentd866599ab4955858b1541f0891b1b165ba66493a
e2fsck: Discard free data and inode blocks.

In Pass 5 when we are checking block and inode bitmaps we have great
opportunity to discard free space and unused inodes on the device,
because bitmaps has just been verified as valid. This commit takes
advantage of this opportunity and discards both, all free space and
unused inodes.

I have added new set of options, 'nodiscard' and 'discard'. When the
underlying devices does not support discard, or discard ends with an
error, or when any kind of error occurs on the filesystem, no further
discard attempt will be made and the e2fsck will behave as it would
with nodiscard option provided.

As an addition, when there is any not-yet-zeroed inode table and
discard zeroes data, then inode table is marked as zeroed.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/e2fsck.8.in
e2fsck/e2fsck.h
e2fsck/pass5.c
e2fsck/unix.c
lib/ext2fs/test_io.c