]> git.karo-electronics.de Git - karo-tx-linux.git/commit
xen-blkfront: improve aproximation of required grants per request
authorRoger Pau Monne <roger.pau@citrix.com>
Mon, 12 Aug 2013 10:53:43 +0000 (12:53 +0200)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tue, 13 Aug 2013 12:39:20 +0000 (08:39 -0400)
commit06a3b60386570f1f240399325653bbb5a89ab8db
tree6376a8ef881c7deacfd8c05155e83ae5ced47282
parent9c405d0dc57d075402971b680712c575c6330ba7
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é <roger.pau@citrix.com>
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/block/xen-blkfront.c