0001
0002 #include <linux/bio.h>
0003 #include <linux/export.h>
0004 #include <xen/xen.h>
0005 #include <xen/page.h>
0006
0007
0008 bool xen_biovec_phys_mergeable(const struct bio_vec *vec1,
0009 const struct page *page)
0010 {
0011 #if XEN_PAGE_SIZE == PAGE_SIZE
0012 unsigned long bfn1 = pfn_to_bfn(page_to_pfn(vec1->bv_page));
0013 unsigned long bfn2 = pfn_to_bfn(page_to_pfn(page));
0014
0015 return bfn1 + PFN_DOWN(vec1->bv_offset + vec1->bv_len) == bfn2;
0016 #else
0017
0018
0019
0020
0021 return false;
0022 #endif
0023 }