direct-io.hg

changeset 11431:383bc7c7b19e

[XEN] gnttab: Read domid/flags atomically.

This more neatly matches how the two adjacent fields in
the grant-table entry are accessed by the cmpxchg()
function.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
author kfraser@ubuntu.eng.hq.xensource.com
date Tue Sep 05 18:36:23 2006 -0700 (2006-09-05)
parents 698eb277331c
children 780409e8f0ba
files xen/common/grant_table.c
line diff
     1.1 --- a/xen/common/grant_table.c	Tue Sep 05 18:28:27 2006 -0700
     1.2 +++ b/xen/common/grant_table.c	Tue Sep 05 18:36:23 2006 -0700
     1.3 @@ -184,8 +184,7 @@ static void
     1.4           (!(op->flags & GNTMAP_readonly) &&
     1.5            !(act->pin & (GNTPIN_hstw_mask|GNTPIN_devw_mask))) )
     1.6      {
     1.7 -        scombo.shorts.flags = sha->flags;
     1.8 -        scombo.shorts.domid = sha->domid;
     1.9 +        scombo.word = *(u32 *)&sha->flags;
    1.10  
    1.11          /*
    1.12           * This loop attempts to set the access (reading/writing) flags
    1.13 @@ -556,8 +555,7 @@ gnttab_prepare_for_transfer(
    1.14  
    1.15      sha = &rgt->shared[ref];
    1.16      
    1.17 -    scombo.shorts.flags = sha->flags;
    1.18 -    scombo.shorts.domid = sha->domid;
    1.19 +    scombo.word = *(u32 *)&sha->flags;
    1.20  
    1.21      for ( ; ; )
    1.22      {
    1.23 @@ -774,8 +772,7 @@ static int
    1.24      if ( !act->pin ||
    1.25           (!readonly && !(act->pin & (GNTPIN_devw_mask|GNTPIN_hstw_mask))) )
    1.26      {
    1.27 -        scombo.shorts.flags = sha->flags;
    1.28 -        scombo.shorts.domid = sha->domid;
    1.29 +        scombo.word = *(u32 *)&sha->flags;
    1.30  
    1.31          for ( ; ; )
    1.32          {