[sheepdog] [PATCH] sheepdog: implement .bdrv_co_is_allocated

Liu Yuan namei.unix at gmail.com
Mon Apr 22 09:00:22 CEST 2013


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




More information about the sheepdog mailing list