<[email protected]> wrote:
> From: ChenLiang <[email protected]>
>
> 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)
> {