]> xenbits.xensource.com Git - people/ssmith/netchannel2-pvops.git/commitdiff
Slightly nicer way of checking whether a page is currently tracked.
authorSteven Smith <ssmith@weybridge.uk.xensource.com>
Thu, 16 Apr 2009 13:30:37 +0000 (14:30 +0100)
committerSteven Smith <ssmith@weybridge.uk.xensource.com>
Tue, 19 May 2009 14:04:12 +0000 (15:04 +0100)
drivers/xen/netback/netback.c
include/xen/live_maps.h

index 2ea96223954e64128d2de36e1e1dd789232b70d4..91063190ffcb10fa889a6a942529b272febdc04e 100644 (file)
@@ -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, &copy_gop->source.domid,
                                    &copy_gop->source.u.ref);
                copy_gop->flags |= GNTCOPY_source_gref;
index 130e151a3fb34c932801aa8751ea2829493832fe..f35b6325a16f02c6ba33a0187384bdfd9a810cbb 100644 (file)
@@ -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__ */