Changeset fc35e98 in mainline for uspace/srv/fs/fat/fat_ops.c
- Timestamp:
- 2011-04-07T19:14:33Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 97bc3ee
- Parents:
- ccca251
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_ops.c
rccca251 rfc35e98 104 104 node->dirty = false; 105 105 node->lastc_cached_valid = false; 106 node->lastc_cached_value = FAT _CLST_LAST1;106 node->lastc_cached_value = FAT16_CLST_LAST1; 107 107 node->currc_cached_valid = false; 108 108 node->currc_cached_bn = 0; 109 node->currc_cached_value = FAT _CLST_LAST1;109 node->currc_cached_value = FAT16_CLST_LAST1; 110 110 } 111 111 … … 945 945 */ 946 946 947 948 #define RootDirSectors(bs) (((RDE(bs)*32) + (BPS(bs)-1)) / BPS(bs)) 949 #define FATSz(bs) SF(bs) != 0 ? SF(bs) : uint32_t_le2host((bs)->fat32.sectors_per_fat) 950 #define DataSec(bs) (TS(bs) - (RSCNT(bs) + (FATCNT(bs) * FATSz(bs)) + RootDirSectors(bs))) 951 #define CountOfClusters(bs) (DataSec(bs) / SPC(bs)) 952 947 953 void fat_mounted(ipc_callid_t rid, ipc_call_t *request) 948 954 { … … 1000 1006 } 1001 1007 1008 /* Storing FAT type (12, 16, 32) in reserved field (bs->reserved) */ 1009 if (CountOfClusters(bs) < 4085) { 1010 /* Volume is FAT12 */ 1011 printf("Found FAT12 filesystem\n"); 1012 (bs)->reserved = 12; 1013 } else if (CountOfClusters(bs) < 65525) { 1014 /* Volume is FAT16 */ 1015 printf("Found FAT16 filesystem\n"); 1016 (bs)->reserved = 16; 1017 } else { 1018 /* Volume is FAT32 */ 1019 printf("FAT32 is not supported by FAT driver. Sorry\n"); 1020 block_fini(devmap_handle); 1021 async_answer_0(rid, ENOTSUP); 1022 return; 1023 1024 } 1025 1002 1026 /* Do some simple sanity checks on the file system. */ 1003 1027 rc = fat_sanity_check(bs, devmap_handle); 1004 1028 if (rc != EOK) { 1029 printf("Sanity check failed\n"); 1005 1030 (void) block_cache_fini(devmap_handle); 1006 1031 block_fini(devmap_handle);
Note:
See TracChangeset
for help on using the changeset viewer.