Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

block: pass page to xen_biovec_phys_mergeable

xen_biovec_phys_mergeable() only needs .bv_page of the 2nd bio bvec
for checking if the two bvecs can be merged, so pass page to
xen_biovec_phys_mergeable() directly.

No function change.

Cc: ris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: xen-devel@lists.xenproject.org
Cc: Omar Sandoval <osandov@fb.com>
Cc: Christoph Hellwig <hch@lst.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Ming Lei and committed by
Jens Axboe
0383ad43 56a85fd8

+7 -4
+1 -1
block/blk.h
··· 75 75 76 76 if (addr1 + vec1->bv_len != addr2) 77 77 return false; 78 - if (xen_domain() && !xen_biovec_phys_mergeable(vec1, vec2)) 78 + if (xen_domain() && !xen_biovec_phys_mergeable(vec1, vec2->bv_page)) 79 79 return false; 80 80 if ((addr1 | mask) != ((addr2 + vec2->bv_len - 1) | mask)) 81 81 return false;
+3 -2
drivers/xen/biomerge.c
··· 4 4 #include <xen/xen.h> 5 5 #include <xen/page.h> 6 6 7 + /* check if @page can be merged with 'vec1' */ 7 8 bool xen_biovec_phys_mergeable(const struct bio_vec *vec1, 8 - const struct bio_vec *vec2) 9 + const struct page *page) 9 10 { 10 11 #if XEN_PAGE_SIZE == PAGE_SIZE 11 12 unsigned long bfn1 = pfn_to_bfn(page_to_pfn(vec1->bv_page)); 12 - unsigned long bfn2 = pfn_to_bfn(page_to_pfn(vec2->bv_page)); 13 + unsigned long bfn2 = pfn_to_bfn(page_to_pfn(page)); 13 14 14 15 return bfn1 + PFN_DOWN(vec1->bv_offset + vec1->bv_len) == bfn2; 15 16 #else
+3 -1
include/xen/xen.h
··· 43 43 #endif /* CONFIG_XEN_DOM0 */ 44 44 45 45 struct bio_vec; 46 + struct page; 47 + 46 48 bool xen_biovec_phys_mergeable(const struct bio_vec *vec1, 47 - const struct bio_vec *vec2); 49 + const struct page *page); 48 50 49 51 #if defined(CONFIG_MEMORY_HOTPLUG) && defined(CONFIG_XEN_BALLOON) 50 52 extern u64 xen_saved_max_mem_size;