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

#include <stdint.h>

#include <skalibs/uint16.h>

#include <shibari/dcache.h>

void dcache_get_data (dcache *z, uint32_t nid, dcache_string *data)
{
  dcache_node *node = DNODE(z, nid) ;
  uint16_t qlen ;
  uint16_unpack_big(node->sa.s + 2, &qlen) ;
  data->s = node->sa.s + 4 + qlen ;
  data->len = node->sa.len - qlen - 4 ;
}