disk-io.h 640 B

123456789101112131415161718192021222324
  1. #ifndef __DISKIO__
  2. #define __DISKIO__
  3. struct tree_buffer {
  4. u64 blocknr;
  5. int count;
  6. union {
  7. struct node node;
  8. struct leaf leaf;
  9. };
  10. };
  11. struct tree_buffer *read_tree_block(struct ctree_root *root, u64 blocknr);
  12. int write_tree_block(struct ctree_root *root, struct tree_buffer *buf);
  13. struct ctree_root *open_ctree(char *filename);
  14. int close_ctree(struct ctree_root *root);
  15. void tree_block_release(struct ctree_root *root, struct tree_buffer *buf);
  16. struct tree_buffer *alloc_free_block(struct ctree_root *root);
  17. int update_root_block(struct ctree_root *root);
  18. int mkfs(int fd);
  19. #define CTREE_SUPER_INFO_OFFSET(bs) (16 * (bs))
  20. #endif