return (req - pending_reqs) * BLKIF_MAX_SEGMENTS_PER_REQUEST + seg;
}
+#define pending_page(req, seg) pending_pages[vaddr_pagenr(req, seg)]
+
static inline unsigned long vaddr(pending_req_t *req, int seg)
{
- unsigned long pfn = page_to_pfn(pending_pages[vaddr_pagenr(req, seg)]);
+ unsigned long pfn = page_to_pfn(pending_page(req, seg));
return (unsigned long)pfn_to_kaddr(pfn);
}
if (ret)
continue;
- set_phys_to_machine(__pa(vaddr(
- pending_req, i)) >> PAGE_SHIFT,
+ set_phys_to_machine(
+ page_to_pfn(pending_page(pending_req, i)),
FOREIGN_FRAME(map[i].dev_bus_addr >> PAGE_SHIFT));
seg[i].buf = map[i].dev_bus_addr |
(req->seg[i].first_sect << 9);
while ((bio == NULL) ||
(bio_add_page(bio,
- virt_to_page(vaddr(pending_req, i)),
+ pending_page(pending_req, i),
seg[i].nsec << 9,
seg[i].buf & ~PAGE_MASK) == 0)) {
if (bio) {