RTEMS  5.1
fat.h
Go to the documentation of this file.
1 
12 /*
13  *
14  * Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia
15  * Author: Eugeny S. Mints <Eugeny.Mints@oktet.ru>
16  *
17  * The license and distribution terms for this file may be
18  * found in the file LICENSE in this distribution or at
19  * http://www.rtems.org/license/LICENSE.
20  */
21 
22 #ifndef __DOSFS_FAT_H__
23 #define __DOSFS_FAT_H__
24 
25 #include <sys/param.h>
26 #include <sys/endian.h>
27 #include <string.h>
28 
29 #include <rtems/seterr.h>
30 
31 #include <errno.h>
32 #include <rtems/bdbuf.h>
33 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 #ifndef RC_OK
45 #define RC_OK 0
46 #endif
47 
48 /*
49  * Remember that all FAT file system on disk data structure is
50  * "little endian"!
51  * (derived from linux)
52  */
53 /*
54  * Conversion from and to little-endian byte order. (no-op on i386/i486)
55  *
56  * Naming: Ca_b_c, where a: F = from, T = to, b: LE = little-endian,
57  * BE = big-endian, c: W = word (16 bits), L = longword (32 bits)
58  */
59 #define CF_LE_W(v) le16toh(v)
60 #define CF_LE_L(v) le32toh(v)
61 #define CT_LE_W(v) htole16(v)
62 #define CT_LE_L(v) htole32(v)
63 
64 #define FAT_HASH_SIZE 2
65 #define FAT_HASH_MODULE FAT_HASH_SIZE
66 
67 
68 #define FAT_SECTOR512_SIZE 512 /* sector size (bytes) */
69 #define FAT_SECTOR512_BITS 9 /* log2(SECTOR_SIZE) */
70 
71 /* maximum + 1 number of clusters for FAT12 */
72 #define FAT_FAT12_MAX_CLN 4085
73 
74 /* maximum + 1 number of clusters for FAT16 */
75 #define FAT_FAT16_MAX_CLN 65525
76 
77 #define FAT_FAT12 0x01
78 #define FAT_FAT16 0x02
79 #define FAT_FAT32 0x04
80 
81 #define FAT_UNDEFINED_VALUE (uint32_t)0xFFFFFFFF
82 
83 #define FAT_FAT12_EOC 0x0FF8
84 #define FAT_FAT16_EOC 0xFFF8
85 #define FAT_FAT32_EOC (uint32_t)0x0FFFFFF8
86 
87 #define FAT_FAT12_FREE 0x0000
88 #define FAT_FAT16_FREE 0x0000
89 #define FAT_FAT32_FREE 0x00000000
90 
91 #define FAT_GENFAT_EOC (uint32_t)0xFFFFFFFF
92 #define FAT_GENFAT_FREE (uint32_t)0x00000000
93 
94 #define FAT_FAT12_SHIFT 0x04
95 
96 #define FAT_FAT12_MASK 0x00000FFF
97 #define FAT_FAT16_MASK 0x0000FFFF
98 #define FAT_FAT32_MASK (uint32_t)0x0FFFFFFF
99 
100 #define FAT_MAX_BPB_SIZE 90
101 #define FAT_TOTAL_MBR_SIZE 512
102 
103 /* size of useful information in FSInfo sector */
104 #define FAT_USEFUL_INFO_SIZE 12
105 
106 #define FAT_GET_ADDR(x, ofs) ((uint8_t *)(x) + (ofs))
107 
108 #define FAT_GET_VAL8(x, ofs) (uint8_t)(*((uint8_t *)(x) + (ofs)))
109 
110 #define FAT_GET_VAL16(x, ofs) \
111  (uint16_t)( (*((uint8_t *)(x) + (ofs))) | \
112  ((*((uint8_t *)(x) + (ofs) + 1)) << 8) )
113 
114 #define FAT_GET_VAL32(x, ofs) \
115  (uint32_t)( (uint32_t)(*((uint8_t *)(x) + (ofs))) | \
116  ((uint32_t)(*((uint8_t *)(x) + (ofs) + 1)) << 8) | \
117  ((uint32_t)(*((uint8_t *)(x) + (ofs) + 2)) << 16) | \
118  ((uint32_t)(*((uint8_t *)(x) + (ofs) + 3)) << 24) )
119 
120 #define FAT_SET_VAL8(x, ofs,val) \
121  (*((uint8_t *)(x)+(ofs))=(uint8_t)(val))
122 
123 #define FAT_SET_VAL16(x, ofs,val) do { \
124  FAT_SET_VAL8((x),(ofs),(val)); \
125  FAT_SET_VAL8((x),(ofs)+1,(val)>>8);\
126  } while (0)
127 
128 #define FAT_SET_VAL32(x, ofs,val) do { \
129  uint32_t val1 = val; \
130  FAT_SET_VAL16((x),(ofs),(val1)&0xffff);\
131  FAT_SET_VAL16((x),(ofs)+2,(val1)>>16);\
132  } while (0)
133 
134 /* macros to access boot sector fields */
135 #define FAT_GET_BR_JMPBOOT(x) FAT_GET_VAL8( x, 0)
136 #define FAT_SET_BR_JMPBOOT(x,val) FAT_SET_VAL8( x, 0,val)
137 
138 #define FAT_GET_ADDR_BR_OEMNAME(x) FAT_GET_ADDR( x, 3)
139 #define FAT_BR_OEMNAME_SIZE (8)
140 
141 #define FAT_GET_BR_BYTES_PER_SECTOR(x) FAT_GET_VAL16(x, 11)
142 #define FAT_SET_BR_BYTES_PER_SECTOR(x,val) FAT_SET_VAL16(x, 11,val)
143 
144 #define FAT_GET_BR_SECTORS_PER_CLUSTER(x) FAT_GET_VAL8( x, 13)
145 #define FAT_SET_BR_SECTORS_PER_CLUSTER(x,val)FAT_SET_VAL8( x, 13,val)
146 
147 #define FAT_GET_BR_RESERVED_SECTORS_NUM(x) FAT_GET_VAL16(x, 14)
148 #define FAT_SET_BR_RESERVED_SECTORS_NUM(x,val) FAT_SET_VAL16(x, 14,val)
149 
150 #define FAT_GET_BR_FAT_NUM(x) FAT_GET_VAL8( x, 16)
151 #define FAT_SET_BR_FAT_NUM(x,val) FAT_SET_VAL8( x, 16,val)
152 
153 #define FAT_GET_BR_FILES_PER_ROOT_DIR(x) FAT_GET_VAL16(x, 17)
154 #define FAT_SET_BR_FILES_PER_ROOT_DIR(x,val) FAT_SET_VAL16(x, 17,val)
155 
156 #define FAT_GET_BR_TOTAL_SECTORS_NUM16(x) FAT_GET_VAL16(x, 19)
157 #define FAT_SET_BR_TOTAL_SECTORS_NUM16(x,val)FAT_SET_VAL16(x, 19,val)
158 
159 #define FAT_GET_BR_MEDIA(x) FAT_GET_VAL8( x, 21)
160 #define FAT_SET_BR_MEDIA(x,val) FAT_SET_VAL8( x, 21,val)
161 
162 #define FAT_GET_BR_SECTORS_PER_FAT(x) FAT_GET_VAL16(x, 22)
163 #define FAT_SET_BR_SECTORS_PER_FAT(x,val) FAT_SET_VAL16(x, 22,val)
164 
165 #define FAT_GET_BR_SECTORS_PER_TRACK(x) FAT_GET_VAL16(x, 24)
166 #define FAT_SET_BR_SECTORS_PER_TRACK(x,val) FAT_SET_VAL16(x, 24,val)
167 
168 #define FAT_GET_BR_NUMBER_OF_HEADS(x) FAT_GET_VAL16(x, 26)
169 #define FAT_SET_BR_NUMBER_OF_HEADS(x,val) FAT_SET_VAL16(x, 26,val)
170 
171 #define FAT_GET_BR_HIDDEN_SECTORS(x) FAT_GET_VAL32(x, 28)
172 #define FAT_SET_BR_HIDDEN_SECTORS(x,val) FAT_SET_VAL32(x, 28,val)
173 
174 #define FAT_GET_BR_TOTAL_SECTORS_NUM32(x) FAT_GET_VAL32(x, 32)
175 #define FAT_SET_BR_TOTAL_SECTORS_NUM32(x,val) FAT_SET_VAL32(x, 32,val)
176  /* --- start of FAT12/16 specific fields */
177 #define FAT_GET_BR_DRVNUM(x) FAT_GET_VAL8( x, 36)
178 #define FAT_SET_BR_DRVNUM(x,val) FAT_SET_VAL8( x, 36,val)
179 
180 #define FAT_GET_BR_RSVD1(x) FAT_GET_VAL8( x, 37)
181 #define FAT_SET_BR_RSVD1(x,val) FAT_SET_VAL8( x, 37,val)
182 
183 #define FAT_GET_BR_BOOTSIG(x) FAT_GET_VAL8( x, 38)
184 #define FAT_SET_BR_BOOTSIG(x,val) FAT_SET_VAL8( x, 38,val)
185 #define FAT_BR_BOOTSIG_VAL (0x29)
186 
187 #define FAT_GET_BR_VOLID(x) FAT_GET_VAL32(x, 39)
188 #define FAT_SET_BR_VOLID(x,val) FAT_SET_VAL32(x, 39,val)
189 
190 #define FAT_GET_ADDR_BR_VOLLAB(x) FAT_GET_ADDR (x, 43)
191 #define FAT_BR_VOLLAB_SIZE (11)
192 
193 #define FAT_GET_ADDR_BR_FILSYSTYPE(x) FAT_GET_ADDR (x, 54)
194 #define FAT_BR_FILSYSTYPE_SIZE (8)
195  /* --- end of FAT12/16 specific fields */
196  /* --- start of FAT32 specific fields */
197 #define FAT_GET_BR_SECTORS_PER_FAT32(x) FAT_GET_VAL32(x, 36)
198 #define FAT_SET_BR_SECTORS_PER_FAT32(x,val) FAT_SET_VAL32(x, 36,val)
199 
200 #define FAT_GET_BR_EXT_FLAGS(x) FAT_GET_VAL16(x, 40)
201 #define FAT_SET_BR_EXT_FLAGS(x,val) FAT_SET_VAL16(x, 40,val)
202 
203 #define FAT_GET_BR_FSVER(x) FAT_GET_VAL16(x, 42)
204 #define FAT_SET_BR_FSVER(x,val) FAT_SET_VAL16(x, 42,val)
205 
206 #define FAT_GET_BR_FAT32_ROOT_CLUSTER(x) FAT_GET_VAL32(x, 44)
207 #define FAT_SET_BR_FAT32_ROOT_CLUSTER(x,val) FAT_SET_VAL32(x, 44,val)
208 
209 #define FAT_GET_BR_FAT32_FS_INFO_SECTOR(x) FAT_GET_VAL16(x, 48)
210 #define FAT_SET_BR_FAT32_FS_INFO_SECTOR(x,val) FAT_SET_VAL16(x, 48,val)
211 
212 #define FAT_GET_BR_FAT32_BK_BOOT_SECTOR(x) FAT_GET_VAL16(x, 50)
213 #define FAT_SET_BR_FAT32_BK_BOOT_SECTOR(x,val) FAT_SET_VAL16(x, 50,val)
214 
215 #define FAT_GET_ADDR_BR_FAT32_RESERVED(x) FAT_GET_ADDR (x, 52)
216 #define FAT_BR_FAT32_RESERVED_SIZE (12)
217 
218 #define FAT_GET_BR_FAT32_DRVNUM(x) FAT_GET_VAL8( x, 64)
219 #define FAT_SET_BR_FAT32_DRVNUM(x,val) FAT_SET_VAL8( x, 64,val)
220 
221 #define FAT_GET_BR_FAT32_RSVD1(x) FAT_GET_VAL8( x, 65)
222 #define FAT_SET_BR_FAT32_RSVD1(x,val) FAT_SET_VAL8( x, 65,val)
223 
224 #define FAT_GET_BR_FAT32_BOOTSIG(x) FAT_GET_VAL8( x, 66)
225 #define FAT_SET_BR_FAT32_BOOTSIG(x,val) FAT_SET_VAL8( x, 66,val)
226 #define FAT_BR_FAT32_BOOTSIG_VAL (0x29)
227 
228 #define FAT_GET_BR_FAT32_VOLID(x) FAT_GET_VAL32(x, 67)
229 #define FAT_SET_BR_FAT32_VOLID(x,val) FAT_SET_VAL32(x, 67,val)
230 
231 #define FAT_GET_ADDR_BR_FAT32_VOLLAB(x) FAT_GET_ADDR (x, 71)
232 #define FAT_BR_FAT32_VOLLAB_SIZE (11)
233 
234 #define FAT_GET_ADDR_BR_FAT32_FILSYSTYPE(x) FAT_GET_ADDR (x, 82)
235 #define FAT_BR_FAT32_FILSYSTYPE_SIZE (8)
236  /* --- end of FAT32 specific fields */
237 
238 #define FAT_GET_BR_SIGNATURE(x) FAT_GET_VAL16(x,510)
239 #define FAT_SET_BR_SIGNATURE(x,val) FAT_SET_VAL16(x,510,val)
240 #define FAT_BR_SIGNATURE_VAL (0xAA55)
241 
242  /*
243  * FAT32 FSINFO description
244  */
245 #define FAT_GET_FSINFO_LEAD_SIGNATURE(x) FAT_GET_VAL32(x, 0)
246 #define FAT_SET_FSINFO_LEAD_SIGNATURE(x,val) FAT_SET_VAL32(x, 0,val)
247 #define FAT_FSINFO_LEAD_SIGNATURE_VALUE (0x41615252)
248 
249 #define FAT_GET_FSINFO_STRUC_SIGNATURE(x) FAT_GET_VAL32(x,484)
250 #define FAT_SET_FSINFO_STRUC_SIGNATURE(x,val) FAT_SET_VAL32(x,484,val)
251 #define FAT_FSINFO_STRUC_SIGNATURE_VALUE (0x61417272)
252 
253 #define FAT_GET_FSINFO_TRAIL_SIGNATURE(x) FAT_GET_VAL32(x,508)
254 #define FAT_SET_FSINFO_TRAIL_SIGNATURE(x,val) FAT_SET_VAL32(x,508,val)
255 #define FAT_FSINFO_TRAIL_SIGNATURE_VALUE (0xAA550000)
256 /*
257  * I read FSInfo sector from offset 484 to access the information, so offsets
258  * of these fields a relative
259  */
260 #define FAT_GET_FSINFO_FREE_CLUSTER_COUNT(x) FAT_GET_VAL32(x, 4)
261 #define FAT_SET_FSINFO_FREE_CLUSTER_COUNT(x,val) FAT_SET_VAL32(x, 4,val)
262 #define FAT_GET_FSINFO_NEXT_FREE_CLUSTER(x) FAT_GET_VAL32(x, 8)
263 #define FAT_SET_FSINFO_NEXT_FREE_CLUSTER(x,val) FAT_SET_VAL32(x, 8,val)
264 
265 #define FAT_FSI_INFO 484
266 #define FAT_FSINFO_STRUCT_OFFSET 488
267 #define FAT_FSINFO_FREE_CLUSTER_COUNT_OFFSET (FAT_FSINFO_STRUCT_OFFSET+0)
268 
269 #define FAT_FSINFO_NEXT_FREE_CLUSTER_OFFSET (FAT_FSINFO_STRUCT_OFFSET+4)
270 
271 #define FAT_RSRVD_CLN 0x02
272 
273 #define FAT_FSI_LEADSIG_SIZE 0x04
274 
275 #define FAT_TOTAL_FSINFO_SIZE 512
276 
277 #define MS_BYTES_PER_CLUSTER_LIMIT 0x10000 /* 64K */
278 #define MS_BYTES_PER_CLUSTER_LIMIT_FAT12 0x1000 /* 4K */
279 
280 #define FAT_BR_EXT_FLAGS_MIRROR 0x0080
281 
282 #define FAT_BR_EXT_FLAGS_FAT_NUM 0x000F
283 
284 #define FAT_BR_MEDIA_FIXED 0xf8
285 
286 #define FAT_DIRENTRY_SIZE 32
287 
288 #define FAT_DIRENTRIES_PER_SEC512 16
289 
290 /*
291  * Volume descriptor
292  * Description of the volume the FAT filesystem is located on - generally
293  * the fields of the structure correspond to Boot Sector and BPB Structure
294  * fields
295  */
296 typedef struct fat_vol_s
297 {
298  uint16_t bps; /* bytes per sector */
299  uint8_t sec_log2; /* log2 of bps */
300  uint8_t sec_mul; /* log2 of 512bts sectors number per sector */
301  uint8_t spc; /* sectors per cluster */
302  uint8_t spc_log2; /* log2 of spc */
303  uint32_t bpc; /* bytes per cluster */
304  uint8_t bpc_log2; /* log2 of bytes per cluster */
305  uint8_t sectors_per_block; /* sectors per bdbuf block */
306  uint32_t bytes_per_block; /* number of bytes for the bduf block device handling */
307  uint8_t bytes_per_block_log2; /* log2 of bytes_per_block */
308  uint8_t fats; /* number of FATs */
309  uint8_t type; /* FAT type */
310  uint32_t mask;
311  uint32_t eoc_val;
312  uint16_t fat_loc; /* FAT start */
313  uint32_t fat_length; /* sectors per FAT */
314  uint32_t rdir_loc; /* root directory start */
315  uint16_t rdir_entrs; /* files per root directory */
316  uint32_t rdir_secs; /* sectors per root directory */
317  uint32_t rdir_size; /* root directory size in bytes */
318  uint32_t tot_secs; /* total count of sectors */
319  uint32_t data_fsec; /* first data sector */
320  uint32_t data_cls; /* count of data clusters */
321  uint32_t rdir_cl; /* first cluster of the root directory */
322  uint16_t info_sec; /* FSInfo Sector Structure location */
323  uint32_t free_cls; /* last known free clusters count */
324  uint32_t free_cls_in_fs_info; /* last known free clusters count
325  in FS info sector */
326  uint32_t next_cl; /* next free cluster number */
327  uint32_t next_cl_in_fs_info; /* next free cluster number in FS
328  info sector */
329  uint8_t mirror; /* mirroring enabla/disable */
330  uint32_t afat_loc; /* active FAT location */
331  uint8_t afat; /* the number of active FAT */
332  int fd; /* the disk device file descriptor */
333  rtems_disk_device *dd; /* disk device (see libblock) */
334  dev_t dev; /* device identifier of disk */
335  void *private_data; /* reserved */
336 } fat_vol_t;
337 
338 
339 typedef struct fat_cache_s
340 {
341  uint32_t blk_num;
342  bool modified;
343  uint8_t state;
344  rtems_bdbuf_buffer *buf;
345 } fat_cache_t;
346 
347 /*
348  * This structure identifies the instance of the filesystem on the FAT
349  * ("fat-file") level.
350  */
351 typedef struct fat_fs_info_s
352 {
353  fat_vol_t vol; /* volume descriptor */
354  rtems_chain_control *vhash; /* "vhash" of fat-file descriptors */
355  rtems_chain_control *rhash; /* "rhash" of fat-file descriptors */
356  char *uino; /* array of unique ino numbers */
357  uint32_t index;
358  uint32_t uino_pool_size; /* size */
359  uint32_t uino_base;
360  fat_cache_t c; /* cache */
361  uint8_t *sec_buf; /* just placeholder for anything */
362 } fat_fs_info_t;
363 
364 /*
365  * FAT position is a the cluster and the offset into the
366  * cluster.
367  */
368 typedef struct fat_pos_s
369 {
370  uint32_t cln;
371  uint32_t ofs;
372 } fat_pos_t;
373 
374 /*
375  * If the name we looking for is file we store not only first data cluster
376  * number, but and cluster number and offset for directory entry for this
377  * name. We also add the LFN start offset so we can delete it the whole
378  * file name. We can then use this to delete the file.
379  */
380 typedef struct fat_dir_pos_s
381 {
382  fat_pos_t sname;
383  fat_pos_t lname;
384 } fat_dir_pos_t;
385 
386 /*
387  * Set the long name entries to this value for a short file name.
388  */
389 #define FAT_FILE_SHORT_NAME (0xffffffff)
390 
391 #define FAT_FAT_OFFSET(fat_type, cln) \
392  ((fat_type) & FAT_FAT12 ? ((cln) + ((cln) >> 1)) : \
393  (fat_type) & FAT_FAT16 ? ((cln) << 1) : \
394  ((cln) << 2))
395 
396 #define FAT_CLUSTER_IS_ODD(n) ((n) & 0x0001)
397 
398 #define FAT12_SHIFT 0x4 /* half of a byte */
399 
400 /* initial size of array of unique ino */
401 #define FAT_UINO_POOL_INIT_SIZE 0x100
402 
403 /* cache support */
404 #define FAT_CACHE_EMPTY 0x0
405 #define FAT_CACHE_ACTUAL 0x1
406 
407 #define FAT_OP_TYPE_READ 0x1
408 #define FAT_OP_TYPE_GET 0x2
409 
410 static inline void
411 fat_dir_pos_init(
412  fat_dir_pos_t *dir_pos
413  )
414 {
415  dir_pos->sname.cln = 0;
416  dir_pos->sname.ofs = 0;
417  dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
418  dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
419 }
420 
421 static inline uint32_t
422 fat_cluster_num_to_sector_num(
423  const fat_fs_info_t *fs_info,
424  uint32_t cln
425  )
426 {
427  if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
428  return fs_info->vol.rdir_loc;
429 
430  return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
431  fs_info->vol.data_fsec);
432 }
433 
434 static inline uint32_t
435 fat_cluster_num_to_sector512_num(
436  const fat_fs_info_t *fs_info,
437  uint32_t cln
438  )
439 {
440  if (cln == 1)
441  return 1;
442 
443  return (fat_cluster_num_to_sector_num(fs_info, cln) <<
444  fs_info->vol.sec_mul);
445 }
446 
447 static inline uint32_t
448  fat_block_num_to_cluster_num (const fat_fs_info_t *fs_info,
449  const uint32_t block_number)
450 {
451  return block_number >> (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2);
452 }
453 
454 static inline uint32_t
455  fat_block_num_to_sector_num (const fat_fs_info_t *fs_info,
456  const uint32_t block_number)
457 {
458  return block_number << (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
459 }
460 
461 static inline uint32_t
462  fat_sector_num_to_block_num (const fat_fs_info_t *fs_info,
463  const uint32_t sector_number)
464 {
465  return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
466 }
467 
468 static inline uint32_t
469  fat_sector_offset_to_block_offset (const fat_fs_info_t *fs_info,
470  const uint32_t sector,
471  const uint32_t sector_offset)
472 {
473  return sector_offset +
474  ((sector -
475  fat_block_num_to_sector_num (fs_info,
476  fat_sector_num_to_block_num (fs_info, sector)))
477  << fs_info->vol.sec_log2);
478 }
479 
480 static inline void
481 fat_buf_mark_modified(fat_fs_info_t *fs_info)
482 {
483  fs_info->c.modified = true;
484 }
485 
486 int
487 fat_buf_access(fat_fs_info_t *fs_info,
488  uint32_t sec_num,
489  int op_type,
490  uint8_t **sec_buf);
491 
492 int
493 fat_buf_release(fat_fs_info_t *fs_info);
494 
495 ssize_t
496 _fat_block_read(fat_fs_info_t *fs_info,
497  uint32_t start,
498  uint32_t offset,
499  uint32_t count,
500  void *buff);
501 
502 ssize_t
503 fat_cluster_write(fat_fs_info_t *fs_info,
504  uint32_t start_cln,
505  uint32_t offset,
506  uint32_t count,
507  const void *buff);
508 
509 ssize_t
510 fat_sector_write(fat_fs_info_t *fs_info,
511  uint32_t start,
512  uint32_t offset,
513  uint32_t count,
514  const void *buff);
515 
516 ssize_t
517 fat_cluster_set(fat_fs_info_t *fs_info,
518  uint32_t start,
519  uint32_t offset,
520  uint32_t count,
521  uint8_t pattern);
522 
523 
524 int
525 fat_init_volume_info(fat_fs_info_t *fs_info, const char *device);
526 
527 int
528 fat_init_clusters_chain(fat_fs_info_t *fs_info,
529  uint32_t start_cln);
530 
531 int
532 fat_shutdown_drive(fat_fs_info_t *fs_info);
533 
534 
535 uint32_t
536 fat_get_unique_ino(fat_fs_info_t *fs_info);
537 
538 bool
539 fat_ino_is_unique(fat_fs_info_t *fs_info,
540  uint32_t ino);
541 
542 void
543 fat_free_unique_ino(fat_fs_info_t *fs_info,
544  uint32_t ino);
545 
546 int
547 fat_sync(fat_fs_info_t *fs_info);
548 
549 #ifdef __cplusplus
550 }
551 #endif
552 
553 #endif /* __DOSFS_FAT_H__ */
Data which Ease the Burden of Consistently Setting Errno.
Definition: fat.h:380
Definition: chain.h:86
Definition: rtemscompat1.h:15
Description of a disk device (logical and physical disks).
Definition: diskdevs.h:157
Definition: fat.h:351
Definition: fat.h:368
Definition: fat.h:339
Definition: bdbuf.h:308
Definition: fat.h:296
Block Device Buffer Management.