Ticket #3003: fat.diff

File fat.diff, 1.7 KB (added by munster, on Apr 21, 2017 at 9:41:56 AM)
  • cpukit/libfs/src/dosfs/fat.c

    diff --git a/cpukit/libfs/src/dosfs/fat.c b/cpukit/libfs/src/dosfs/fat.c
    index a0475d4610..f537c7e6c5 100644
    a b fat_init_volume_info(fat_fs_info_t *fs_info, const char *device) 
    566566    for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0;
    567567         i >>= 1, vol->spc_log2++);
    568568
    569     /*
    570      * "bytes per cluster" value greater than 32K is invalid
    571      */
    572     if (vol->bps > (MS_BYTES_PER_CLUSTER_LIMIT >> vol->spc_log2))
    573     {
    574         close(vol->fd);
    575         rtems_set_errno_and_return_minus_one(EINVAL);
    576     }
    577 
    578569    vol->bpc = vol->bps << vol->spc_log2;
    579570
    580571    for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0;
  • cpukit/libfs/src/dosfs/fat.h

    diff --git a/cpukit/libfs/src/dosfs/fat.h b/cpukit/libfs/src/dosfs/fat.h
    index 1cbf9a7247..e2937153ab 100644
    a b typedef struct fat_vol_s 
    298298    uint16_t           bps;            /* bytes per sector */
    299299    uint8_t            sec_log2;       /* log2 of bps */
    300300    uint8_t            sec_mul;        /* log2 of 512bts sectors number per sector */
     301    uint32_t           bpc;            /* bytes per cluster */
     302    uint8_t            bpc_log2;       /* log2 of bytes per cluster */
    301303    uint8_t            spc;            /* sectors per cluster */
    302304    uint8_t            spc_log2;       /* log2 of spc */
    303     uint16_t           bpc;            /* bytes per cluster */
    304     uint8_t            bpc_log2;       /* log2 of bytes per cluster */
    305305    uint8_t            sectors_per_block;    /* sectors per bdbuf block */
    306306    uint16_t           bytes_per_block;      /* number of bytes for the bduf block device handling */
    307307    uint8_t            bytes_per_block_log2; /* log2 of bytes_per_block */