OSDN Git Service

vfio/ccw: pass page count to page_array struct
authorEric Farman <farman@linux.ibm.com>
Fri, 21 Oct 2022 14:59:13 +0000 (16:59 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Mon, 9 Jan 2023 13:34:08 +0000 (14:34 +0100)
commit62a97a56a64c97c3865e55d702babc22f3b2ea6a
tree6ced03ad5e881ce28234ca5105c6907336ef81a4
parent4b946d65b8aa0071dbbc54b35b8502fa99c1ee22
vfio/ccw: pass page count to page_array struct

The allocation of our page_array struct calculates the number
of 4K pages that would be needed to hold a certain number of
bytes. But, since the number of pages that will be pinned is
also calculated by the length of the IDAL, this logic is
unnecessary. Let's pass that information in directly, and
avoid the math within the allocator.

Also, let's make this two allocations instead of one,
to make it apparent what's happening within here.

Signed-off-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
drivers/s390/cio/vfio_ccw_cp.c