summaryrefslogtreecommitdiff
path: root/src/libdcache/dcache_search.c
blob: 0239b8812a0063d02e82f9b6ccfb4f24e4408c8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* ISC license. */

#include <stdint.h>

#include <skalibs/avltree.h>

#include <shibari/dcache.h>
#include "dcache-internal.h"

dcache_node_t *dcache_search (dcache_t *z, char const *key, uint16_t keylen)
{
  uint32_t i ;
  dcache_key_t k = { .s = (char *)key, .len = keylen } ;
  return avltree_search(&z->by_key, &k, &i) ? DNODE(z, i) : 0 ;
}