/* interface function to delete all the snapshots we have scheduled for deletion  */
int btrfs_clean_old_snapshots(struct btrfs_root *root)
/* interface function to delete all the snapshots we have scheduled for deletion  */
int btrfs_clean_old_snapshots(struct btrfs_root *root)
{
	LIST_HEAD(list);
	struct btrfs_fs_info *fs_info = root->fs_info;
	mutex_lock(&fs_info->trans_mutex);
	list_splice_init(&fs_info->dead_roots, &list);
	mutex_unlock(&fs_info->trans_mutex);
	while (!list_empty(&list)) {
		root = list_entry(list.next, struct btrfs_root, root_list);
		list_del(&root->root_list);
		if (btrfs_header_backref_rev(root->node) <
		    BTRFS_MIXED_BACKREF_REV)
			btrfs_drop_snapshot(root, 0);
		else
			btrfs_drop_snapshot(root, 1);
	}
	return 0;
}