[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>
This commit is contained in:
kfraser@ubuntu.eng.hq.xensource.com committed 2006-09-05 18:36:23 -07:00
1 parent a97227a56d
commit 7c0fc730a3
1 file changed
+3 -6
+3 -6
View File
@@ -184,8 +184,7 @@ __gnttab_map_grant_ref(
(!(op->flags & GNTMAP_readonly) &&
!(act->pin & (GNTPIN_hstw_mask|GNTPIN_devw_mask))) )
{
scombo.shorts.flags = sha->flags;
scombo.shorts.domid = sha->domid;
scombo.word = *(u32 *)&sha->flags;
/*
* This loop attempts to set the access (reading/writing) flags
@@ -556,8 +555,7 @@ gnttab_prepare_for_transfer(
sha = &rgt->shared[ref];
scombo.shorts.flags = sha->flags;
scombo.shorts.domid = sha->domid;
scombo.word = *(u32 *)&sha->flags;
for ( ; ; )
{
@@ -774,8 +772,7 @@ __acquire_grant_for_copy(
if ( !act->pin ||
(!readonly && !(act->pin & (GNTPIN_devw_mask|GNTPIN_hstw_mask))) )
{
scombo.shorts.flags = sha->flags;
scombo.shorts.domid = sha->domid;
scombo.word = *(u32 *)&sha->flags;
for ( ; ; )
{
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.