[sheepdog] [PATCH UPDATE] sheep: initialize reclaim work queue only when cache is enabled

Liu Yuan namei.unix at gmail.com
Wed Aug 29 13:14:32 CEST 2012


On 08/29/2012 03:21 PM, levin li wrote:
> From: levin li <xingke.lwp at taobao.com>
> 
> 
> Signed-off-by: levin li <xingke.lwp at taobao.com>
> ---
>  sheep/sheep.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/sheep/sheep.c b/sheep/sheep.c
> index ea25a05..36e059a 100644
> --- a/sheep/sheep.c
> +++ b/sheep/sheep.c
> @@ -373,9 +373,13 @@ int main(int argc, char **argv)
>  	sys->deletion_wqueue = init_work_queue("deletion", true);
>  	sys->block_wqueue = init_work_queue("block", true);
>  	sys->sockfd_wqueue = init_work_queue("sockfd", true);
> -	sys->reclaim_wqueue = init_work_queue("reclaim", true);
> +	if (sys->enable_write_cache) {
> +		sys->reclaim_wqueue = init_work_queue("reclaim", true);
> +		if (!sys->reclaim_wqueue)
> +			exit(1);
> +	}
>  	if (!sys->gateway_wqueue || !sys->io_wqueue ||!sys->recovery_wqueue ||
> -	    !sys->deletion_wqueue || !sys->block_wqueue || !sys->reclaim_wqueue)
> +	    !sys->deletion_wqueue || !sys->block_wqueue || !sys->sockfd_wqueue)
>  		exit(1);
>  
>  	ret = trace_init();
> 

Applied, thanks.

Yuan



More information about the sheepdog mailing list