[sheepdog] [PATCH v2 2/9] sheep: add cmd argument -W to specify a max cache size

levin li levin108 at gmail.com
Thu Jul 26 03:49:47 CEST 2012


On 2012年07月26日 08:09, MORITA Kazutaka wrote:
> At Wed, 25 Jul 2012 20:15:18 +0800,
> levin li wrote:
>>
>> From: levin li <xingke.lwp at taobao.com>
>>
>>
>> Signed-off-by: levin li <xingke.lwp at taobao.com>
>> ---
>>  sheep/sheep.c      |   16 +++++++++++++++-
>>  sheep/sheep_priv.h |    2 ++
>>  2 files changed, 17 insertions(+), 1 deletion(-)
>>
>> diff --git a/sheep/sheep.c b/sheep/sheep.c
>> index 380a129..8b78669 100644
>> --- a/sheep/sheep.c
>> +++ b/sheep/sheep.c
>> @@ -48,12 +48,13 @@ static struct option const long_options[] = {
>>  	{"port", required_argument, NULL, 'p'},
>>  	{"vnodes", required_argument, NULL, 'v'},
>>  	{"enable-cache", no_argument, NULL, 'w'},
>> +	{"cache-size", optional_argument, NULL, 'W'},
> 
> If '-w' and '-W' are always used at the same time, how about making
> '-w' optional_argument?  For example, to set the max cache size to
> 100M,
> 
>  $ sheep -w 100 -d /store
> 
> 
> Thanks,
> 
> Kazutaka
> 


Currently, -W is not always needed even if -w is used, if no -W, it means
the cache will never be reclaimed.

If we use -w like the way you mentioned, maybe we can not use it like the
following way to specify that no cache will be reclaimed.

$ sheep -w -d /store


thanks,

levin




More information about the sheepdog mailing list