Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset cb052b4 in mainline


Ignore:
Timestamp:
2011-04-30T08:02:46Z (11 years ago)
Author:
Oleg Romanenko <romanenko.oleg@…>
Branches:
lfn, master
Children:
875edff6
Parents:
ce8f4f4
Message:
  1. Add new macros for determining FAT32 (FAT_IS_FAT32) and change existing macros: FAT_CLST_LAST1,

FAT_CLST_LAST8, FAT_CLST_BAD to support FAT32

  1. Allow to mount FAT32 filesystem
  2. Known issue: FAT32 fs does not pass sanity checks because of support 32-bit fat_cluster_t is required.
Location:
uspace/srv/fs/fat
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/fat/fat_fat.h

    rce8f4f4 rcb052b4  
    5050#define FAT16_CLST_LAST1  0xfff8
    5151#define FAT16_CLST_LAST8  0xffff
     52#define FAT32_CLST_BAD    0x0ffffff7
     53#define FAT32_CLST_LAST1  0x0ffffff8
     54#define FAT32_CLST_LAST8  0x0fffffff
    5255
    5356#define FAT12_CLST_MAX    4085
     
    7275#define FAT_IS_FAT16(bs) \
    7376    ((CC(bs) >= FAT12_CLST_MAX) && (CC(bs) < FAT16_CLST_MAX))
     77#define FAT_IS_FAT32(bs)        (CC(bs) >= FAT16_CLST_MAX)
    7478
    7579#define FAT_CLST_LAST1(bs) \
    76     (FAT_IS_FAT12(bs) ? FAT12_CLST_LAST1 : FAT16_CLST_LAST1)
     80    (FAT_IS_FAT12(bs) ? FAT12_CLST_LAST1 : (FAT_IS_FAT32(bs) ? FAT32_CLST_LAST1 : FAT16_CLST_LAST1))
    7781#define FAT_CLST_LAST8(bs) \
    78     (FAT_IS_FAT12(bs) ? FAT12_CLST_LAST8 : FAT16_CLST_LAST8)
     82    (FAT_IS_FAT12(bs) ? FAT12_CLST_LAST8 : (FAT_IS_FAT32(bs) ? FAT32_CLST_LAST8 : FAT16_CLST_LAST8))
    7983#define FAT_CLST_BAD(bs) \
    80     (FAT_IS_FAT12(bs) ? FAT12_CLST_BAD : FAT16_CLST_BAD)
     84    (FAT_IS_FAT12(bs) ? FAT12_CLST_BAD : (FAT_IS_FAT32(bs) ? FAT32_CLST_BAD : FAT16_CLST_BAD))
    8185
    8286/* forward declarations */
  • uspace/srv/fs/fat/fat_ops.c

    rce8f4f4 rcb052b4  
    10031003        }
    10041004
    1005         /* Return NOT SUPPORTED if try to mount FAT32  */
    1006         if (!FAT_IS_FAT12(bs) && !FAT_IS_FAT16(bs)) {
    1007                 block_fini(devmap_handle);
    1008                 async_answer_0(rid, ENOTSUP);
    1009                 return;
    1010         }
    1011 
    10121005        /* Do some simple sanity checks on the file system. */
    10131006        rc = fat_sanity_check(bs, devmap_handle);
Note: See TracChangeset for help on using the changeset viewer.