exfat_cache.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Copyright (C) 2012-2013 Samsung Electronics Co., Ltd.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version 2
  7. * of the License, or (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  17. */
  18. #ifndef _EXFAT_CACHE_H
  19. #define _EXFAT_CACHE_H
  20. #include "exfat_config.h"
  21. #include "exfat_global.h"
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. #define LOCKBIT 0x01
  26. #define DIRTYBIT 0x02
  27. #define DCACHE_MAX_RA_SIZE (128*1024)
  28. typedef struct __BUF_CACHE_T {
  29. struct __BUF_CACHE_T *next;
  30. struct __BUF_CACHE_T *prev;
  31. struct __BUF_CACHE_T *hash_next;
  32. struct __BUF_CACHE_T *hash_prev;
  33. INT32 drv;
  34. UINT32 sec;
  35. UINT32 flag;
  36. struct buffer_head *buf_bh;
  37. } BUF_CACHE_T;
  38. INT32 buf_init(struct super_block *sb);
  39. INT32 buf_shutdown(struct super_block *sb);
  40. INT32 FAT_read(struct super_block *sb, UINT32 loc, UINT32 *content);
  41. INT32 FAT_write(struct super_block *sb, UINT32 loc, UINT32 content);
  42. UINT8 *FAT_getblk(struct super_block *sb, UINT32 sec);
  43. void FAT_modify(struct super_block *sb, UINT32 sec);
  44. void FAT_release_all(struct super_block *sb);
  45. void FAT_sync(struct super_block *sb);
  46. UINT8 *buf_getblk(struct super_block *sb, UINT32 sec);
  47. void buf_modify(struct super_block *sb, UINT32 sec);
  48. void buf_lock(struct super_block *sb, UINT32 sec);
  49. void buf_unlock(struct super_block *sb, UINT32 sec);
  50. void buf_release(struct super_block *sb, UINT32 sec);
  51. void buf_release_all(struct super_block *sb);
  52. void buf_sync(struct super_block *sb);
  53. INT32 buf_cache_readahead(struct super_block * sb, UINT32 sec);
  54. #ifdef __cplusplus
  55. }
  56. #endif
  57. #endif