/* For a cached entry, this function increases the reference count and returns the entry.  */
CachedL2Table* qed_find_l2_cache_entry(L2TableCache *l2_cache, uint64_t offset)
/* For a cached entry, this function increases the reference count and returns the entry.  */
CachedL2Table* qed_find_l2_cache_entry(L2TableCache *l2_cache, uint64_t offset)
{
    CachedL2Table *entry;
    QTAILQ_FOREACH(entry, &l2_cache->entries, node) {
        if (entry->offset == offset) {
            trace_qed_find_l2_cache_entry(l2_cache, entry, offset, entry->ref);
            entry->ref++;
            return entry;
        }
    }
    return NULL;
}