qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 04/10] XBZRLE: rebuild the cache_is_cached funct


From: Juan Quintela
Subject: Re: [Qemu-devel] [PATCH 04/10] XBZRLE: rebuild the cache_is_cached function
Date: Tue, 11 Mar 2014 21:37:31 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

<address@hidden> wrote:
> From: ChenLiang <address@hidden>
>
> Rebuild the cache_is_cached function.

Why?

> +bool cache_is_cached(const PageCache *cache, uint64_t addr,
> +                     uint64_t current_age)
> +{
> +    CacheItem *it = NULL;

s/= NULL//

Thanks, Juan.

> +
> +    it = cache_get_by_addr(cache, addr);
> +
> +    if (it->it_addr == addr) {
> +        /* updata the it_age when the cache hit */
> +        it->it_age = current_age;
> +        return true;
> +    }
> +    return false;
> +}
> +
>  int cache_insert(PageCache *cache, uint64_t addr, const uint8_t *pdata,
>                   uint64_t current_age)
>  {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]