From: Steven Smith Date: Thu, 16 Apr 2009 13:30:37 +0000 (+0100) Subject: Slightly nicer way of checking whether a page is currently tracked. X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=3cedc3fdab00f0858170e7715aa527cdce5cb74f;p=people%2Fssmith%2Fnetchannel2-pvops.bak.git%2F.git Slightly nicer way of checking whether a page is currently tracked. --- diff --git a/drivers/xen/netback/netback.c b/drivers/xen/netback/netback.c index 2ea96223954..91063190ffc 100644 --- a/drivers/xen/netback/netback.c +++ b/drivers/xen/netback/netback.c @@ -303,7 +303,7 @@ static u16 netbk_gop_frag(struct xen_netif *netif, struct netbk_rx_meta *meta, copy_gop = npo->copy + npo->copy_prod++; copy_gop->flags = GNTCOPY_dest_gref; - if (PageForeign(page) && page->mapping != NULL) { + if (page_is_tracked(page)) { lookup_tracker_page(page, ©_gop->source.domid, ©_gop->source.u.ref); copy_gop->flags |= GNTCOPY_source_gref; diff --git a/include/xen/live_maps.h b/include/xen/live_maps.h index 130e151a3fb..f35b6325a16 100644 --- a/include/xen/live_maps.h +++ b/include/xen/live_maps.h @@ -135,4 +135,9 @@ static inline void lookup_tracker_page(struct page *p, domid_t *dom, *gref = pft->contents[idx & LIVE_MAP_TRACKER_IDX_MASK].gref; } +static inline int page_is_tracked(struct page *p) +{ + return PageForeign(p) && p->mapping; +} + #endif /* !XEN_LIVE_MAPS_H__ */