2 * Copyright (C) 2012-2013 Samsung Electronics Co., Ltd.
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.
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.
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.
19 /************************************************************************/
21 /* PROJECT : exFAT & FAT12/16/32 File System */
22 /* FILE : exfat_cache.h */
23 /* PURPOSE : Header File for exFAT Cache Manager */
24 /* (FAT Cache & Buffer Cache) */
26 /*----------------------------------------------------------------------*/
29 /*----------------------------------------------------------------------*/
30 /* REVISION HISTORY (Ver 0.9) */
32 /* - 2010.11.15 [Sung-Kwan Kim] : first writing */
34 /************************************************************************/
36 #ifndef _EXFAT_CACHE_H
37 #define _EXFAT_CACHE_H
39 #include "exfat_config.h"
40 #include "exfat_global.h"
44 #endif /* __cplusplus */
46 /*----------------------------------------------------------------------*/
47 /* Constant & Macro Definitions */
48 /*----------------------------------------------------------------------*/
53 /*----------------------------------------------------------------------*/
54 /* Type Definitions */
55 /*----------------------------------------------------------------------*/
57 typedef struct __BUF_CACHE_T
{
58 struct __BUF_CACHE_T
*next
;
59 struct __BUF_CACHE_T
*prev
;
60 struct __BUF_CACHE_T
*hash_next
;
61 struct __BUF_CACHE_T
*hash_prev
;
65 struct buffer_head
*buf_bh
;
68 /*----------------------------------------------------------------------*/
69 /* External Function Declarations */
70 /*----------------------------------------------------------------------*/
72 INT32
buf_init(struct super_block
*sb
);
73 INT32
buf_shutdown(struct super_block
*sb
);
74 INT32
FAT_read(struct super_block
*sb
, UINT32 loc
, UINT32
*content
);
75 INT32
FAT_write(struct super_block
*sb
, UINT32 loc
, UINT32 content
);
76 UINT8
*FAT_getblk(struct super_block
*sb
, UINT32 sec
);
77 void FAT_modify(struct super_block
*sb
, UINT32 sec
);
78 void FAT_release_all(struct super_block
*sb
);
79 void FAT_sync(struct super_block
*sb
);
80 UINT8
*buf_getblk(struct super_block
*sb
, UINT32 sec
);
81 void buf_modify(struct super_block
*sb
, UINT32 sec
);
82 void buf_lock(struct super_block
*sb
, UINT32 sec
);
83 void buf_unlock(struct super_block
*sb
, UINT32 sec
);
84 void buf_release(struct super_block
*sb
, UINT32 sec
);
85 void buf_release_all(struct super_block
*sb
);
86 void buf_sync(struct super_block
*sb
);
90 #endif /* __cplusplus */
92 #endif /* _EXFAT_CACHE_H */
94 /* end of exfat_cache.h */