]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: assert that delayed item is a dir index item when adding it
authorFilipe Manana <fdmanana@suse.com>
Tue, 31 May 2022 15:06:39 +0000 (16:06 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Jul 2022 15:44:35 +0000 (17:44 +0200)
commit807091f7d0a701883ac5906cfa9f1c459aea1989
tree56055491a532eb6e44db6062d688f49090c8f8dd
parent5dc45ba7d5d4a7c418df2884c7e87942d23ced30
btrfs: assert that delayed item is a dir index item when adding it

All delayed items are for dir index items, we don't support any other item
types at the moment. So simplify __btrfs_add_delayed_item() and add an
assertion for checking the item's key type. This also allows the next
change to be simpler and avoid to check key types. In case we add support
for different item types in the future, then we'll hit the assertion
during development and be able to adjust any code that is assuming delayed
items are always associated to dir index items.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/delayed-inode.c