>>> On 18.12.15 at 11:06, <malcolm.cross...@citrix.com> wrote: > --- a/xen/include/xen/grant_table.h > +++ b/xen/include/xen/grant_table.h > @@ -51,13 +51,35 @@ > /* The maximum size of a grant table. */ > extern unsigned int max_grant_frames; > > +DECLARE_PERCPU_RWLOCK_GLOBAL(grant_rwlock); > + > +static inline void grant_percpu_read_lock(percpu_rwlock_t *lock) > +{ > + percpu_read_lock(grant_rwlock, lock); > +} > + > +static inline void grant_percpu_read_unlock(percpu_rwlock_t *lock) > +{ > + percpu_read_unlock(grant_rwlock, lock); > +} > + > +static inline void grant_percpu_write_lock(percpu_rwlock_t *lock) > +{ > + percpu_write_lock(grant_rwlock, lock); > +} > + > +static inline void grant_percpu_write_unlock(percpu_rwlock_t *lock) > +{ > + percpu_write_unlock(grant_rwlock, lock); > +}
These should all be taking struct grant_table * arguments, so they can't be accidentally used on some other per-CPU r/w lock. I also question the need for the "percpu" in their names. Jan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel