[sheepdog] [Qemu-devel] [PATCH v2 2/2] sheepdog: implement .bdrv_co_is_allocated()

Liu Yuan namei.unix at gmail.com
Mon Apr 22 17:18:51 CEST 2013


On 04/22/2013 11:03 PM, Stefan Hajnoczi wrote:
> Imagine sector_num = 0 and nb_sectors = SD_DATA_OBJ_SIZE / BDRV_SECTOR_SIZE.
> 
> start = 0
> end = 1
> 
> You don't want object 1, only object 0.

Hmm, math, ouch. So nb_sectors include sector_num? What I mean is

If [start, end] mean a range of sectors,so

1. nb_sectors = end - start + 1 (I assume this one)
2. nb_sectors = end - start (you meant this one?)

which one is correct for .co_is_allocated?

Thanks,
Yuan



More information about the sheepdog mailing list