[sheepdog] [PATCH 3/6] sheep: add vdi_copy tree to store copies number for every VDI
levin li
levin108 at gmail.com
Mon Aug 6 09:38:53 CEST 2012
On 2012年08月06日 15:03, Liu Yuan wrote:
> On 08/06/2012 01:59 PM, levin li wrote:
>> The normal requests from QEMU include the copies number in its header,
>> QEMU stores the nr_copies the first time it reads the inode data, but
>> many other local requests such as read_copy_from_replica and
>> recover_object_from_replica don't know the copies number for every object,
>> so this tree is necessary to keep the copies number
>>
>> Signed-off-by: levin li <xingke.lwp at taobao.com>
>> ---
>> sheep/Makefile.am | 2 +-
>> sheep/object_list_cache.c | 1 +
>> sheep/ops.c | 4 +-
>> sheep/sheep_priv.h | 5 ++
>> sheep/vdi_copies.c | 115 +++++++++++++++++++++++++++++++++++++++++++++
>
> Fold vdi_copies.c into vdi.c. We should follow the general practice:
> 1 standalone file for internal object concept, such as request.c,
> object_cache.c, etc. So all vdi related should be placed in vdi.c. If
> the concept can't be explained by one file, such as Farm, trace, we can
> create a directory for it.
>
> Thanks,
> Yuan
>
The original reason makes me to split vdi_copies from vdi.c is that vdi_copies
uses pthread, and the variable ctime in vdi.c shadows a variable in pthread.h,
if merge them together, can you give some suggestion what to rename ctime ? is
create_time OK ?
thanks,
levin
More information about the sheepdog
mailing list