[Sheepdog] [PATCH] sheep: bypass check_request() for cached object

Liu Yuan namei.unix at gmail.com
Wed May 2 04:53:35 CEST 2012


On 05/01/2012 06:40 PM, Liu Yuan wrote:

> From: Liu Yuan <tailai.ly at taobao.com>
> 
> if we go for a cached object, we don't care if it is busy
> or being recovered.
> 
> Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
> ---
>  sheep/sdnet.c |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
> 
> diff --git a/sheep/sdnet.c b/sheep/sdnet.c
> index a28874e..1e001af 100644
> --- a/sheep/sdnet.c
> +++ b/sheep/sdnet.c
> @@ -208,6 +208,15 @@ static int check_epoch(struct request *req)
>  
>  static int check_request(struct request *req)
>  {
> +	struct sd_obj_req *hdr = (struct sd_obj_req *)&req->rq;
> +
> +	/*
> +	 * if we go for a cached object, we don't care if it is busy
> +	 * or being recovered.
> +	 */
> +	if ((hdr->flags & SD_FLAG_CMD_CACHE) && object_is_cached(hdr->oid))
> +		return 0;
> +
>  	if (!req->local_oid && !req->local_cow_oid)
>  		return 0;
>  	else {


Applied.

Thanks,
Yuan



More information about the sheepdog mailing list