lkml.org 
[lkml]   [2018]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3/6] xenbus: dispatch per-domU watch event to per-domU xenwatch thread
From
Date
On 9/14/18 3:34 AM, Dongli Zhang wrote:
>
> +static int xs_watch_insert_event(struct xs_watch_event *event, domid_t domid)
> +{
> + struct mtwatch_domain *domain;
> + int ret = -1;

-ENODEV maybe?

-boris

> +
> + rcu_read_lock();
> +
> + domain = mtwatch_find_domain(domid);
> + if (!domain) {
> + rcu_read_unlock();
> + return ret;
> + }
> +
> + spin_lock(&domain->events_lock);
> + if (domain->state == MTWATCH_DOMAIN_UP) {
> + list_add_tail(&event->list, &domain->events);
> + wake_up(&domain->events_wq);
> + ret = 0;
> + }
> + spin_unlock(&domain->events_lock);
> +
> + rcu_read_unlock();
> +
> + return ret;
> +}
> +
>

\
 
 \ /
  Last update: 2018-09-17 22:08    [W:0.336 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site