btrfs: set delayed item type when initializing it
authorFilipe Manana <fdmanana@suse.com>
Tue, 31 May 2022 15:06:42 +0000 (16:06 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Jul 2022 15:44:36 +0000 (17:44 +0200)
commitc9d02ab4b436cd6a40e772b0b727a8de6cea9d4a
tree9a4a980a8202cb34304acab5631550f8aebfe5a2
parent3bae13e9d42eae0fea7afd6a9aea6b4fe81770ad
btrfs: set delayed item type when initializing it

Currently we set the type of a delayed item only after successfully
inserting it into its respective rbtree. This is fine, as the type
is not used anywhere before that point, but for the next patch in the
series, there will be the need to check the type of a delayed item
before inserting it into a rbtree.

So set the type of a delayed item immediately after allocating it.
This also makes the trivial wrappers for adding insertion and deletion
useless, so it removes them as well.

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