btrfs: tests: add a test for btrfs_add_extent_mapping
authorJosef Bacik <josef@toxicpanda.com>
Thu, 17 Aug 2023 20:57:32 +0000 (16:57 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Aug 2023 12:54:49 +0000 (14:54 +0200)
commitf345dbdf2c9c4733d52b9389da6c02672f3b8672
tree43f3a53660f3a0270091934e77491d796e7b31de
parent89c3760428db0342edf2747240419c9b34db3485
btrfs: tests: add a test for btrfs_add_extent_mapping

This helper is different from the normal add_extent_mapping in that it
will stuff an em into a gap that exists between overlapping em's in the
tree.  It appeared there was a bug so I wrote a self test to validate it
did the correct thing when it worked with two side by side ems.
Thankfully it is correct, but more testing is better.

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/tests/extent-map-tests.c