lkml.org 
[lkml]   [2017]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 11/18] xen/pvcalls: implement accept command
On Fri, 26 May 2017, Boris Ostrovsky wrote:
> > static void __pvcalls_back_accept(struct work_struct *work)
> > {
> > + struct sockpass_mapping *mappass = container_of(
> > + work, struct sockpass_mapping, register_work);
> > + struct sock_mapping *map;
> > + struct pvcalls_ioworker *iow;
> > + struct pvcalls_back_priv *priv;
> > + struct xen_pvcalls_response *rsp;
> > + struct xen_pvcalls_request *req;
> > + void *page = NULL;
> > + int notify;
> > + int ret = -EINVAL;
> > + unsigned long flags;
> > +
> > + priv = mappass->priv;
> > + /* We only need to check the value of "cmd" atomically on read. */
> > + spin_lock_irqsave(&mappass->copy_lock, flags);
> > + req = &mappass->reqcopy;
> > + if (req->cmd != PVCALLS_ACCEPT) {
> > + spin_unlock_irqrestore(&mappass->copy_lock, flags);
> > + return;
> > + }
> > + spin_unlock_irqrestore(&mappass->copy_lock, flags);
> > +
> > + map = kzalloc(sizeof(*map), GFP_KERNEL);
>
> >From here on, the code looks almost identical to connect. Can this be
> factored out?

Yes, good idea, I'll do that

\
 
 \ /
  Last update: 2017-06-05 00:14    [W:0.067 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site