Changeset 53f2ca3 in rtems


Ignore:
Timestamp:
05/31/12 11:50:08 (11 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, master
Children:
6b24b88, b824fb8
Parents:
f164ae75
Message:

dosfs: Fix format request with sectors per cluster

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libfs/src/dosfs/msdos_format.c

    rf164ae75 r53f2ca3  
    485485       * are a compromise concerning capacity and efficency
    486486       */
     487      uint32_t fat12_sect_per_clust = 8;
     488      uint32_t fat16_sect_per_clust = 32;
     489
     490      if (rqdata != NULL && rqdata->sectors_per_cluster != 0) {
     491        fat12_sect_per_clust = rqdata->sectors_per_cluster;
     492        fat16_sect_per_clust = rqdata->sectors_per_cluster;
     493      }
     494
    487495      if (fmt_params->totl_sector_cnt
    488           < ((uint32_t)FAT_FAT12_MAX_CLN)*8) {
     496          < FAT_FAT12_MAX_CLN * fat12_sect_per_clust) {
    489497        fmt_params->fattype = FAT_FAT12;
    490498        /* start trying with small clusters */
     
    492500      }
    493501      else if (fmt_params->totl_sector_cnt
    494                < ((uint32_t)FAT_FAT16_MAX_CLN)*32) {
     502               < FAT_FAT16_MAX_CLN * fat16_sect_per_clust) {
    495503        fmt_params->fattype = FAT_FAT16;
    496504        /* start trying with small clusters */
Note: See TracChangeset for help on using the changeset viewer.