sffs_vfs.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
  2. * All rights reserved.
  3. *
  4. * This software is supplied "AS IS" without any warranties.
  5. * RDA assumes no responsibility or liability for the use of the software,
  6. * conveys no license or title under any patent, copyright, or mask work
  7. * right to the product. RDA reserves the right to make changes in the
  8. * software without notification. RDA also make no representation or
  9. * warranty that such application will be suitable for the specified use
  10. * without further testing or modification.
  11. */
  12. #ifndef _SFFS_VFS_H_
  13. #define _SFFS_VFS_H_
  14. #include <stdbool.h>
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. struct blockDevice;
  19. /**
  20. * mount SFFS to VFS
  21. *
  22. * @param base_path mount point in VFS
  23. * @param bdev block device pointer
  24. * @param cache_count block cache count in SFFS
  25. * @param sfile_reserved_lb reserved logical block for sfile
  26. * @param read_only whether to mount as read-only
  27. * @return
  28. * - 0 on success
  29. * - -1 on fail
  30. */
  31. int sffsVfsMount(const char *base_path,
  32. struct blockDevice *bdev,
  33. size_t cache_count,
  34. size_t sfile_reserved_lb,
  35. bool read_only);
  36. /**
  37. * format SFFS on block device
  38. *
  39. * @param bdev block device pointer
  40. * @return
  41. * - 0 on success
  42. * - -1 on fail
  43. */
  44. int sffsVfsMkfs(struct blockDevice *bdev);
  45. #ifdef __cplusplus
  46. }
  47. #endif
  48. #endif