Whamcloud - gitweb
AOSP: e2fsdroid: Allow re-use of deduplicated blocks.
authorDavid Anderson <dvander@google.com>
Thu, 5 Dec 2019 22:00:28 +0000 (14:00 -0800)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 1 Jan 2020 18:41:35 +0000 (13:41 -0500)
commit0f3291fdf14f84e928930a671d41dd69d674b4ff
tree75f75ba1b2fe3f5003da59c11e6b1649b061cb7d
parentaf4d3f8916f72a4756468d1277ded1d2e371e32b
AOSP: e2fsdroid: Allow re-use of deduplicated blocks.

When using a Base FS map, track deduplicated blocks in a separate
bitmap. The first inode to request a block from this set will succeed
in getting the block. Blocks in the dedup set are not available for
libext2fs to allocate; this ensures that previously deduplicated blocks
are re-used for their original purpose.

Note that deduplication takes priority over block allocation, so that
once a block is removed from the dedup set, that does not actually
prevent it from being re-used. Similarly, a file that was not previously
sharing a block may have its blocks shared in the new image.

Bug: 145316683
Test: e2fsdroid with dynamic partitions
Change-Id: I73856faa5d294a7b5fb985ccd1a6974a989481ea
From AOSP commit: 4e55425ff5d7d7cea27dcf79125766762e2b3529
contrib/android/basefs_allocator.c