On 2012年08月24日 14:11, MORITA Kazutaka wrote:
> At Fri, 24 Aug 2012 13:36:47 +0800,
> levin li wrote:
>>
>> From: levin li <xingke....@taobao.com>
>>
>>
>> Signed-off-by: levin li <xingke....@taobao.com>
>> ---
>>  collie/common.c    |   32 ++++++++++++++++----------------
>>  include/sheep.h    |    5 +++++
>>  sheep/sheep_priv.h |    5 -----
>>  3 files changed, 21 insertions(+), 21 deletions(-)
>>
>> diff --git a/collie/common.c b/collie/common.c
>> index 364e36c..c03cab7 100644
>> --- a/collie/common.c
>> +++ b/collie/common.c
>> @@ -126,16 +126,16 @@ int sd_write_object(uint64_t oid, uint64_t cow_oid, 
>> void *data, unsigned int dat
>>  
>>  int parse_vdi(vdi_parser_func_t func, size_t size, void *data)
>>  {
>> -    int ret, fd;
>> +    int ret, fd, count;
>> +    struct vdi_copy *vc;
>>      unsigned long nr;
>>      static struct sheepdog_inode i;
>>      struct sd_req req;
>> -    static DECLARE_BITMAP(vdi_inuse, SD_NR_VDIS);
>> -    unsigned int wlen = 0, rlen = sizeof(vdi_inuse) * 2;
>> -    char *buf;
>> +    struct sd_rsp *rsp = (struct sd_rsp *)&req;
>> +    unsigned int wlen = 0, rlen = SD_NR_VDIS;
> 
> Should be "rlen = SD_NR_VDIS * sizeof(*vc)"?

I think SD_NR_VDIS is big enough, it can contain up to 2097152
vdi copy entries, 2097152 VDIs are more than enough for our cluster,
and by this we don't need to allocate the 128M memory for such
a request, what do you think about it?

thanks,

levin

> 
> Thanks,
> 
> Kazutaka
> 

-- 
sheepdog mailing list
sheepdog@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to