Changeset 26ad20b in mainline
- Timestamp:
- 2011-08-24T22:38:31Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 24738df
- Parents:
- 81e9cb3
- Location:
- uspace/app/mkfat
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/mkfat/fat.h
r81e9cb3 r26ad20b 47 47 #define FAT32 32 48 48 49 #define FAT_SIZE(a) (( a==FAT12)? 1.5 : ( (a==FAT16)? 2 : 4 ))49 #define FAT_SIZE(a) (((a) == FAT12) ? 1.5 : (((a) == FAT16) ? 2 : 4)) 50 50 51 51 typedef struct fat_bs { -
uspace/app/mkfat/mkfat.c
r81e9cb3 r26ad20b 215 215 static void syntax_print(void) 216 216 { 217 printf("syntax: mkfat 32[--size <sectors>] [--type 12|16|32] <device_name>\n");217 printf("syntax: mkfat [--size <sectors>] [--type 12|16|32] <device_name>\n"); 218 218 } 219 219 … … 229 229 230 230 /* 231 232 233 234 235 231 * Make a conservative guess on the FAT size needed for the file 232 * system. The optimum could be potentially smaller since we 233 * do not subtract size of the FAT itself when computing the 234 * size of the data region. 235 */ 236 236 237 237 if (cfg->fat_type == FAT12) … … 242 242 cfg->rootdir_sectors = div_round_up(cfg->root_ent_max * DIRENT_SIZE, 243 243 cfg->sector_size); 244 } 245 else 244 } else 246 245 cfg->rootdir_sectors = 0; 247 246 non_data_sectors_lb = cfg->reserved_sectors + cfg->rootdir_sectors; … … 251 250 252 251 if ((cfg->fat_type == FAT12 && cfg->total_clusters > FAT12_CLST_MAX) || 253 254 252 (cfg->fat_type == FAT16 && (cfg->total_clusters <= FAT12_CLST_MAX || 253 cfg->total_clusters > FAT16_CLST_MAX)) || 255 254 (cfg->fat_type == FAT32 && cfg->total_clusters <= FAT16_CLST_MAX)) 256 255 return ENOSPC; … … 340 339 } 341 340 } else { 342 for (i =0; i<cfg->sectors_per_cluster; i++) {341 for (i = 0; i < cfg->sectors_per_cluster; i++) { 343 342 rc = block_write_direct(service_id, addr, 1, buffer); 344 343 if (rc != EOK)
Note:
See TracChangeset
for help on using the changeset viewer.