Am 19.04.2010 17:56, schrieb Stefan Hajnoczi: > The BlockDriver bdrv_getlength function is called from the I/O code path > when checking that the request falls within the device. Unfortunately > this involves an lseek system call in the raw protocol; every read or > write request will incur this lseek cost. > > Jan Kiszka <jan.kis...@siemens.com> identified this issue and its > latency overhead. This patch caches device length in the existing > total_sectors variable so lseek calls can be avoided for fixed size > devices. > > Growable devices fall back to the full bdrv_getlength code path because > I have not added logic to detect extending the size of the device in a > write. > > Signed-off-by: Stefan Hajnoczi <stefa...@linux.vnet.ibm.com> > --- > v2: > - Introduced refresh_total_sectors() to clean up total_sectors updates > - Added error handling for refresh_total_sectors() callers
Looks good, applied to the block branch. Kevin