[Sheepdog] [PATCH 3/4] object list cache: move it out of store.c

Liu Yuan namei.unix at gmail.com
Tue May 1 08:23:16 CEST 2012


On 05/01/2012 05:48 AM, MORITA Kazutaka wrote:

> At Tue,  1 May 2012 00:16:25 +0800,
> Liu Yuan wrote:
>>
>> From: Liu Yuan <tailai.ly at taobao.com>
>>
>>
>> Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
>> ---
>>  sheep/Makefile.am         |    2 +-
>>  sheep/object_list_cache.c |  151 +++++++++++++++++++++++++++++++++++++++++++++
>>  2 files changed, 152 insertions(+), 1 deletions(-)
>>  create mode 100644 sheep/object_list_cache.c
>>
>> diff --git a/sheep/Makefile.am b/sheep/Makefile.am
>> index 507a497..7448ae1 100644
>> --- a/sheep/Makefile.am
>> +++ b/sheep/Makefile.am
>> @@ -26,7 +26,7 @@ sbin_PROGRAMS		= sheep
>>  
>>  sheep_SOURCES		= sheep.c group.c sdnet.c store.c vdi.c work.c \
>>  			  journal.c ops.c recovery.c cluster/local.c strbuf.c \
>> -			  simple_store.c object_cache.c
>> +			  simple_store.c object_cache.c object_list_cache.c
>>  
>>  if BUILD_COROSYNC
>>  sheep_SOURCES		+= cluster/corosync.c
>> diff --git a/sheep/object_list_cache.c b/sheep/object_list_cache.c
>> new file mode 100644
>> index 0000000..73a395a
>> --- /dev/null
>> +++ b/sheep/object_list_cache.c
>> @@ -0,0 +1,151 @@
>> +/*
>> + * Copyright (C) 2011 Taobao Inc.
> 
> Should this line be "Copyright (C) 2012 Taobao Inc."?

Ah, yes.

> And, probably, you should remove object_cache code from sheep/store.c
> in this patch.
> 


No, I don't think so. The object cache implementation is already
encapsulated into object_cache.c. Both bypass_object_cache() and
handle_gateway_request() are higher level code that just make use of
object cache. So I think it would be better to leave them in the store.c

Thanks,
Yuan



More information about the sheepdog mailing list