Skip to contentSkip to conversation

Use gnttab_clear_flag() to clear flags

PATCH New Jimi Xenidis 1 participant 1 message Aug 13, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use gnttab_clear_flag() to clear flags

We also add #define to catch offenders early.

---

xen/common/grant_table.c +9 -2
diff -r 5f92043a3ab1 xen/common/grant_table.c
@@ -32,6 +32,13 @@
 #include <xen/guest_access.h>
 #include <acm/acm_hooks.h>
 
+/*
+ * This file uses a special method for clearing bit in the flags called:
+ *    gnttab_clear_flag()
+ * We redefine clear_bit() here to catch offenders early.
+ */
+#define clear_bit(flags, ptr) please_use_gnttab_clear_flag();
+
 /* The first to members of a grant entry are updated as a combined
  * pair.  The following union allows that to happen in an endian
  * neutral fashion. */
@@ -738,10 +745,10 @@ __release_grant_for_copy(
         act->pin -= GNTPIN_hstw_inc;
 
     if ( !(act->pin & GNTPIN_hstw_mask) && !readonly )
-        clear_bit(_GTF_writing, &sha->flags);
+        gnttab_clear_flag(_GTF_writing, &sha->flags);
 
     if ( !act->pin )
-        clear_bit(_GTF_reading, &sha->flags);
+        gnttab_clear_flag(_GTF_reading, &sha->flags);
     spin_unlock(&rd->grant_table->lock);
 }