[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [sheepdog] [PATCH] sheepdog: implement .bdrv_co_is_allo
From: |
Liu Yuan |
Subject: |
Re: [Qemu-devel] [sheepdog] [PATCH] sheepdog: implement .bdrv_co_is_allocated |
Date: |
Mon, 22 Apr 2013 15:00:22 +0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 |
On 04/22/2013 02:01 PM, MORITA Kazutaka wrote:
> It looks better to use BDRV_SECTOR_SIZE . I'd suggest preparing
> another patch to replace all the SECTOR_SIZE with BDRV_SECTOR_SIZE.
>
Okay
>> > + end = start + (nb_sectors * SECTOR_SIZE) /
>> > SD_DATA_OBJ_SIZE;
> Using 'start' to calculate 'end' is wrong because 'start' may be
> rounded down.
>
Good catch. Will updated it in v2
>> > +
>> > + for (idx = start; idx <= end; idx++) {
>> > + if (inode->data_vdi_id[idx] == 0) {
>> > + break;
>> > + }
>> > + }
>> > + if (idx == start) {
>> > + *pnum = SD_DATA_OBJ_SIZE / SECTOR_SIZE;
> Isn't it better to set the longest length of the unallocated sectors?
>
Good idea.
Thanks,
Yuan