Make blocktree indir block sizes variable.
[vcfs.git] / blocktree.h
CommitLineData
d5cf5351 1#ifndef _BLOCKTREE_H
2#define _BLOCKTREE_H
3
4#include "store.h"
5#include "inttypes.h"
6
d5cf5351 7typedef loff_t block_t;
8
9struct btnode {
10 u_int8_t d;
11 struct addr a;
12};
13
14struct btop {
15 block_t blk;
16 void *buf;
17 size_t len;
18 int (*fillfn)(void *buf, size_t len, void *pdata);
19 void *pdata;
20};
21
34b0b353 22ssize_t btget(struct store *st, struct btnode *tree, block_t bl, void *buf, size_t len, size_t blsize);
23int btputmany(struct store *st, struct btnode *tree, struct btop *ops, int numops, size_t blsize);
24int btput(struct store *st, struct btnode *tree, block_t bl, void *buf, size_t len, size_t blsize);
25block_t btcount(struct store *st, struct btnode *tree, size_t blsize);
d5cf5351 26void btsortops(struct btop *ops, int numops);
27void btmkop(struct btop *op, block_t bl, void *buf, size_t len);
28
29#endif