Ignore:
File:
1 edited

Legend:

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

    r7efc517 red903174  
    9393
    9494        while (clst < FAT_CLST_LAST1 && clusters < max_clusters) {
    95                 bn_t fsec;      /* sector offset relative to FAT1 */
     95                aoff64_t fsec;  /* sector offset relative to FAT1 */
    9696                unsigned fidx;  /* FAT1 entry index */
    9797
     
    135135int
    136136_fat_block_get(block_t **block, fat_bs_t *bs, dev_handle_t dev_handle,
    137     fat_cluster_t firstc, bn_t bn, int flags)
     137    fat_cluster_t firstc, aoff64_t bn, int flags)
    138138{
    139139        unsigned bps;
     
    148148        int rc;
    149149
     150        /*
     151         * This function can only operate on non-zero length files.
     152         */
     153        if (firstc == FAT_CLST_RES0)
     154                return ELIMIT;
     155
    150156        bps = uint16_t_le2host(bs->bps);
    151157        rscnt = uint16_t_le2host(bs->rscnt);
     
    190196 * @return              EOK on success or a negative error code.
    191197 */
    192 int fat_fill_gap(fat_bs_t *bs, fat_node_t *nodep, fat_cluster_t mcl, off_t pos)
     198int fat_fill_gap(fat_bs_t *bs, fat_node_t *nodep, fat_cluster_t mcl, aoff64_t pos)
    193199{
    194200        uint16_t bps;
    195201        unsigned spc;
    196202        block_t *b;
    197         off_t o, boundary;
     203        aoff64_t o, boundary;
    198204        int rc;
    199205
     
    361367        uint16_t rscnt;
    362368        uint16_t sf;
    363         uint16_t ts;
     369        uint32_t ts;
    364370        unsigned rde;
    365371        unsigned rds;
     
    379385        sf = uint16_t_le2host(bs->sec_per_fat);
    380386        rde = uint16_t_le2host(bs->root_ent_max);
    381         ts = uint16_t_le2host(bs->totsec16);
     387        ts = (uint32_t) uint16_t_le2host(bs->totsec16);
     388        if (ts == 0)
     389                ts = uint32_t_le2host(bs->totsec32);
    382390
    383391        rds = (sizeof(fat_dentry_t) * rde) / bps;
Note: See TracChangeset for help on using the changeset viewer.