Re: [Qemu-devel] Re: [PATCH 2/2] block: Cache total_sectors to reduce bdrv_getlength calls

2010-04-19 Thread Kevin Wolf
Am 19.04.2010 16:26, schrieb Stefan Hajnoczi: > On Mon, Apr 19, 2010 at 3:10 PM, Kevin Wolf wrote: >>> @@ -416,9 +417,7 @@ static int bdrv_open_common(BlockDriverState *bs, const >>> char *filename, >>> } >>> >>> bs->keep_read_only = bs->read_only = !(open_flags & BDRV_O_RDWR); >>> -

Re: [Qemu-devel] Re: [PATCH 2/2] block: Cache total_sectors to reduce bdrv_getlength calls

2010-04-19 Thread Stefan Hajnoczi
On Mon, Apr 19, 2010 at 3:10 PM, Kevin Wolf wrote: >> @@ -416,9 +417,7 @@ static int bdrv_open_common(BlockDriverState *bs, const >> char *filename, >>      } >> >>      bs->keep_read_only = bs->read_only = !(open_flags & BDRV_O_RDWR); >> -    if (drv->bdrv_getlength) { >> -        bs->total_sect

[Qemu-devel] Re: [PATCH 2/2] block: Cache total_sectors to reduce bdrv_getlength calls

2010-04-19 Thread Kevin Wolf
Am 19.04.2010 14:34, 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 l