btrfs: add self test for bytes_index free space cache
authorJosef Bacik <josef@toxicpanda.com>
Thu, 18 Nov 2021 21:33:16 +0000 (16:33 -0500)
committerDavid Sterba <dsterba@suse.com>
Mon, 3 Jan 2022 14:09:46 +0000 (15:09 +0100)
commitbbf27275f246a105a1e906f22a4f814f89bf4b55
treedf214ab13c8d71c47696b765d8ad9a286ec417e1
parent59c7b566a3b653fe7865cef007c053fd88de8317
btrfs: add self test for bytes_index free space cache

I noticed a few corner cases when looking at my bytes_index patch for
obvious bugs, so add a bunch of tests to validate proper behavior of the
bytes_index tree.  A couple of basic tests to make sure it puts things
in the correct order, and then more complicated tests to make sure it
re-arranges bitmap entries properly and does the right thing when we try
to make allocations.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/tests/free-space-tests.c