Block delete function added (probably buggy).
[vcfs.git] / blocktree.h
CommitLineData
d5cf5351 1#ifndef _BLOCKTREE_H
2#define _BLOCKTREE_H
3
4#include "store.h"
5#include "inttypes.h"
6
7#define BT_INDBITS 10
8#define BT_INDSZ (1 << BT_INDBITS)
9#define BT_INDBSZ (sizeof(struct btnode) * BT_INDSZ)
10
11typedef loff_t block_t;
12
13struct btnode {
14 u_int8_t d;
15 struct addr a;
16};
17
18struct btop {
19 block_t blk;
20 void *buf;
21 size_t len;
22 int (*fillfn)(void *buf, size_t len, void *pdata);
23 void *pdata;
24};
25
26ssize_t btget(struct store *st, struct btnode *tree, block_t bl, void *buf, size_t len);
27int btputmany(struct store *st, struct btnode *tree, struct btop *ops, int numops);
28int btput(struct store *st, struct btnode *tree, block_t bl, void *buf, size_t len);
29block_t btcount(struct store *st, struct btnode *tree);
30void btsortops(struct btop *ops, int numops);
31void btmkop(struct btop *op, block_t bl, void *buf, size_t len);
32
33#endif