xen-blkfront: improve aproximation of required grants per request
Improve the calculation of required grants to process a request by
using nr_phys_segments instead of always assuming a request is going
to use all posible segments.
nr_phys_segments contains the number of scatter-gather DMA addr+len
pairs, which is basically what we put at every granted page.
for_each_sg iterates over the DMA addr+len pairs and uses a grant
page for each of them.
Signed-off-by: Roger Pau Monné <firstname.lastname@example.org>
Reviewed-by: David Vrabel <email@example.com>
Cc: Konrad Rzeszutek Wilk <firstname.lastname@example.org>
Cc: David Vrabel <email@example.com>
Signed-off-by: Konrad Rzeszutek Wilk <firstname.lastname@example.org>
1 file changed