ext4_mp.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /** @addtogroup lwext4
  2. * @{
  3. */
  4. /**
  5. * @file ext4_mp.h
  6. * @brief mount point handle functions
  7. */
  8. #ifndef EXT4_MP_H_
  9. #define EXT4_MP_H_
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. #include <ext4_config.h>
  14. #include <ext4_types.h>
  15. #include <ext4_fs.h>
  16. #include <ext4_journal.h>
  17. #include <stdint.h>
  18. /**@brief Mount point OS dependent lock*/
  19. #define EXT4_MP_LOCK(_m) \
  20. do { \
  21. if ((_m)->os_locks) \
  22. (_m)->os_locks->lock(); \
  23. } while (0)
  24. /**@brief Mount point OS dependent unlock*/
  25. #define EXT4_MP_UNLOCK(_m) \
  26. do { \
  27. if ((_m)->os_locks) \
  28. (_m)->os_locks->unlock(); \
  29. } while (0)
  30. /**@brief Mount point descriptor.*/
  31. struct ext4_mountpoint {
  32. /**@brief Mount done flag.*/
  33. bool mounted;
  34. /**@brief Mount point name (@ref ext4_mount)*/
  35. char name[CONFIG_EXT4_MAX_MP_NAME + 1];
  36. /**@brief OS dependent lock/unlock functions.*/
  37. const struct ext4_lock *os_locks;
  38. /**@brief Ext4 filesystem internals.*/
  39. struct ext4_fs fs;
  40. /**@brief JBD fs.*/
  41. struct jbd_fs jbd_fs;
  42. /**@brief Journal.*/
  43. struct jbd_journal jbd_journal;
  44. /**@brief Block cache.*/
  45. struct ext4_bcache bc;
  46. };
  47. #ifdef __cplusplus
  48. }
  49. #endif
  50. #endif /* EXT4_MP_H_ */