There are only two possible types of the delayed ref action, this can be
verified at the beginning for the whole function and not just one block.
Replace the assertion with a debugging warning just in case.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
struct btrfs_delayed_ref_node *exist;
int mod;
+ ASSERT(ref->action == BTRFS_ADD_DELAYED_REF ||
+ ref->action == BTRFS_DROP_DELAYED_REF);
+
spin_lock(&href->lock);
exist = tree_insert(&href->ref_tree, ref);
if (!exist) {
ASSERT(!list_empty(&exist->add_list));
list_del_init(&exist->add_list);
} else {
- ASSERT(0);
+ DEBUG_WARN();
}
} else
mod = -ref->ref_mod;