struct page_foreign_tracked {
domid_t dom;
grant_ref_t gref;
+ void *ctxt;
#ifdef LIVE_MAPS_DEBUG
unsigned in_use;
#endif
should be no tracked pages when this is called. */
void free_page_foreign_tracker(struct page_foreign_tracker *pft);
+static inline struct page_foreign_tracker *tracker_for_page(struct page *p)
+{
+ unsigned idx = page_private(p);
+ return foreign_trackers[idx >> LIVE_MAP_TRACKER_IDX_BITS];
+}
+
/* Start tracking a page. @idx is an index in the tracker which is
not currently in use, and must be less than the size of the
tracker. The page must be marked as foreign before this is called.
struct page *p,
domid_t dom,
grant_ref_t gref,
- unsigned idx)
+ unsigned idx,
+ void *ctxt)
{
BUG_ON(!PageForeign(p));
#ifdef LIVE_MAPS_DEBUG
struct page_foreign_tracker *pft;
unsigned idx = page_private(p);
BUG_ON(!PageForeign(p));
- pft = foreign_trackers[idx >> LIVE_MAP_TRACKER_IDX_BITS];
+ pft = tracker_for_page(p);
BUG_ON((idx & LIVE_MAP_TRACKER_IDX_MASK) >= pft->size);
BUG_ON(!pft->contents[idx & LIVE_MAP_TRACKER_IDX_MASK].in_use);
pft->contents[idx & LIVE_MAP_TRACKER_IDX_MASK].in_use = 0;
struct page_foreign_tracker *pft;
unsigned idx = page_private(p);
BUG_ON(!PageForeign(p));
- pft = foreign_trackers[idx >> LIVE_MAP_TRACKER_IDX_BITS];
+ pft = tracker_for_page(p);
#ifdef LIVE_MAPS_DEBUG
BUG_ON(!pft);
BUG_ON((idx & LIVE_MAP_TRACKER_IDX_MASK) >= pft->size);