Chris Mason | eb60cea | 2007-02-02 09:18:22 -0500 | [diff] [blame] | 1 | #ifndef __DISKIO__ |
| 2 | #define __DISKIO__ |
| 3 | |
| 4 | struct tree_buffer { |
| 5 | u64 blocknr; |
| 6 | int count; |
| 7 | union { |
| 8 | struct node node; |
| 9 | struct leaf leaf; |
| 10 | }; |
| 11 | }; |
| 12 | |
| 13 | struct tree_buffer *read_tree_block(struct ctree_root *root, u64 blocknr); |
Chris Mason | 9a8dd15 | 2007-02-23 08:38:36 -0500 | [diff] [blame] | 14 | struct tree_buffer *find_tree_block(struct ctree_root *root, u64 blocknr); |
Chris Mason | eb60cea | 2007-02-02 09:18:22 -0500 | [diff] [blame] | 15 | int write_tree_block(struct ctree_root *root, struct tree_buffer *buf); |
Chris Mason | cfaa729 | 2007-02-21 17:04:57 -0500 | [diff] [blame] | 16 | struct ctree_root *open_ctree(char *filename, struct ctree_super_block *s); |
Chris Mason | eb60cea | 2007-02-02 09:18:22 -0500 | [diff] [blame] | 17 | int close_ctree(struct ctree_root *root); |
| 18 | void tree_block_release(struct ctree_root *root, struct tree_buffer *buf); |
Chris Mason | cfaa729 | 2007-02-21 17:04:57 -0500 | [diff] [blame] | 19 | int write_ctree_super(struct ctree_root *root, struct ctree_super_block *s); |
Chris Mason | d97e63b | 2007-02-20 16:40:44 -0500 | [diff] [blame] | 20 | int mkfs(int fd); |
| 21 | |
| 22 | #define CTREE_SUPER_INFO_OFFSET(bs) (16 * (bs)) |
Chris Mason | eb60cea | 2007-02-02 09:18:22 -0500 | [diff] [blame] | 23 | |
| 24 | #endif |