summaryrefslogtreecommitdiffstats
path: root/drivers/xen/evtchn.c
diff options
context:
space:
mode:
authorDaniel De Graaf <dgdegra@tycho.nsa.gov>2011-10-27 23:58:47 +0200
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-11-21 23:14:48 +0100
commit420eb554d5ee6daad743d8190383219f757dd66c (patch)
tree0c8b69dbc2de5aea96be93a24a8b39dbb9256b88 /drivers/xen/evtchn.c
parentxen/gnt{dev,alloc}: reserve event channels for notify (diff)
downloadlinux-420eb554d5ee6daad743d8190383219f757dd66c.tar.xz
linux-420eb554d5ee6daad743d8190383219f757dd66c.zip
xen/event: Add reference counting to event channels
Event channels exposed to userspace by the evtchn module may be used by other modules in an asynchronous manner, which requires that reference counting be used to prevent the event channel from being closed before the signals are delivered. The reference count on new event channels defaults to -1 which indicates the event channel is not referenced outside the kernel; evtchn_get fails if called on such an event channel. The event channels made visible to userspace by evtchn have a normal reference count. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/xen/evtchn.c')
-rw-r--r--drivers/xen/evtchn.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c
index dbc13e94b612..b1f60a0c0bea 100644
--- a/drivers/xen/evtchn.c
+++ b/drivers/xen/evtchn.c
@@ -268,7 +268,7 @@ static int evtchn_bind_to_user(struct per_user_data *u, int port)
rc = bind_evtchn_to_irqhandler(port, evtchn_interrupt, IRQF_DISABLED,
u->name, (void *)(unsigned long)port);
if (rc >= 0)
- rc = 0;
+ rc = evtchn_make_refcounted(port);
return rc;
}