@@ -642,7 +642,7 @@ int evtchn_close(struct domain *d1, int
*/
write_unlock(&chn1->lock);
write_unlock(&chn2->lock);
- put_domain(d2);
+ rcu_unlock_domain(d2);
chn2 = NULL;
}
@@ -677,7 +677,7 @@ int evtchn_close(struct domain *d1, int
*/
write_unlock(&chn1->lock);
write_unlock(&chn2->lock);
- put_domain(d2);
+ rcu_unlock_domain(d2);
chn2 = NULL;
}
@@ -725,9 +725,8 @@ int evtchn_close(struct domain *d1, int
if ( !chn2 )
{
- /* If we unlock chn1 then we could lose d2. Must get a reference. */
- if ( unlikely(!get_domain(d2)) )
- BUG();
+ /* If we unlock chn1 then we could lose d2. */
+ rcu_lock_domain(d2);
chn2 = _evtchn_from_port(d2, chn1->u.interdomain.remote_port);
BUG_ON(!chn2);
@@ -778,7 +777,7 @@ int evtchn_close(struct domain *d1, int
*/
write_unlock(&chn1->lock);
write_unlock(&chn2->lock);
- put_domain(d2);
+ rcu_unlock_domain(d2);
}
write_unlock(&d1->event_lock);
For short-lived references rcu_lock_domain() is the better (slightly cheaper) alternative. Signed-off-by: Jan Beulich <jbeulich@suse.com>