@@ -420,7 +420,7 @@ struct domain *domain_create(domid_t domid, unsigned int domcr_flags,
radix_tree_destroy(&d->pirq_tree, free_pirq_struct);
}
if ( init_status & INIT_rangeset )
- rangeset_domain_destroy(d);
+ rangeset_list_destroy(&d->rangesets);
if ( init_status & INIT_watchdog )
watchdog_domain_destroy(d);
if ( init_status & INIT_xsm )
@@ -815,7 +815,7 @@ static void complete_domain_destroy(struct rcu_head *head)
watchdog_domain_destroy(d);
- rangeset_domain_destroy(d);
+ rangeset_list_destroy(&d->rangesets);
sched_destroy_domain(d);
@@ -381,20 +381,17 @@ void rangeset_limit(
r->nr_ranges = limit;
}
-void rangeset_domain_destroy(
- struct domain *d)
+void rangeset_list_destroy(struct list_head *list)
{
struct rangeset *r;
- while ( !list_empty(&d->rangesets) )
+ while ( !list_empty(list) )
{
- r = list_entry(d->rangesets.next, struct rangeset, rangeset_list);
+ r = list_entry(list->next, struct rangeset, rangeset_list);
- BUG_ON(r->domain != d);
- r->domain = NULL;
list_del(&r->rangeset_list);
- rangeset_destroy(r);
+ rangeset_destroy(r, NULL);
}
}
@@ -18,14 +18,9 @@ struct spinlock;
struct rangeset;
/*
- * Destroy per-domain rangeset information.
- *
- * It is invalid to create or destroy a rangeset belonging to a domain @d
- * before rangeset_domain_initialise(d) returns or after calling
- * rangeset_domain_destroy(d).
+ * Destroy a list of rangesets.
*/
-void rangeset_domain_destroy(
- struct domain *d);
+void rangeset_list_destroy(struct list_head *list);
/*
* Create a rangeset. Optionally attach to a specified list @head.