blob: 2729b757ddc1e1172ec8f71b66dec3e88968ecdc [file] [log] [blame]
Chris Masoneb60cea2007-02-02 09:18:22 -05001#ifndef __DISKIO__
2#define __DISKIO__
3
4struct tree_buffer {
5 u64 blocknr;
6 int count;
7 union {
8 struct node node;
9 struct leaf leaf;
10 };
11};
12
13struct tree_buffer *read_tree_block(struct ctree_root *root, u64 blocknr);
Chris Mason9a8dd152007-02-23 08:38:36 -050014struct tree_buffer *find_tree_block(struct ctree_root *root, u64 blocknr);
Chris Masoneb60cea2007-02-02 09:18:22 -050015int write_tree_block(struct ctree_root *root, struct tree_buffer *buf);
Chris Masoncfaa7292007-02-21 17:04:57 -050016struct ctree_root *open_ctree(char *filename, struct ctree_super_block *s);
Chris Masoneb60cea2007-02-02 09:18:22 -050017int close_ctree(struct ctree_root *root);
18void tree_block_release(struct ctree_root *root, struct tree_buffer *buf);
Chris Masoncfaa7292007-02-21 17:04:57 -050019int write_ctree_super(struct ctree_root *root, struct ctree_super_block *s);
Chris Masond97e63b2007-02-20 16:40:44 -050020int mkfs(int fd);
21
22#define CTREE_SUPER_INFO_OFFSET(bs) (16 * (bs))
Chris Masoneb60cea2007-02-02 09:18:22 -050023
24#endif