lfs.h 569 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * The little filesystem
  3. *
  4. * Copyright (c) 2017 Christopher Haster
  5. * Distributed under the MIT license
  6. */
  7. #ifndef LFS_H
  8. #define LFS_H
  9. #include "lfs_config.h"
  10. #include "lfs_bd.h"
  11. struct lfs_free_list {
  12. lfs_ino_t head;
  13. lfs_word_t ioff;
  14. lfs_word_t icount;
  15. lfs_word_t rev;
  16. };
  17. typedef struct lfs {
  18. lfs_bd_t *bd;
  19. const struct lfs_bd_ops *ops;
  20. struct lfs_free_list free;
  21. struct lfs_bd_info info;
  22. } lfs_t;
  23. lfs_error_t lfs_create(lfs_t *lfs, lfs_bd_t *bd, const struct lfs_bd_ops *bd_ops);
  24. lfs_error_t lfs_format(lfs_t *lfs);
  25. #endif