Ignore:
File:
1 edited

Legend:

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

    r3a8faba r2f636b6  
    359359        uint16_t rscnt;
    360360        uint16_t sf;
    361         uint16_t ts;
    362         unsigned rde;
    363         unsigned rds;
    364         unsigned ssa;
    365361        block_t *blk;
    366362        fat_cluster_t *lifo;    /* stack for storing free cluster numbers */
     
    376372        rscnt = uint16_t_le2host(bs->rscnt);
    377373        sf = uint16_t_le2host(bs->sec_per_fat);
    378         rde = uint16_t_le2host(bs->root_ent_max);
    379         ts = uint16_t_le2host(bs->totsec16);
    380 
    381         rds = (sizeof(fat_dentry_t) * rde) / bps;
    382         rds += ((sizeof(fat_dentry_t) * rde) % bps != 0);
    383         ssa = rscnt + bs->fatcnt * sf + rds;
    384374       
    385375        /*
     
    392382                        goto error;
    393383                for (c = 0; c < bps / sizeof(fat_cluster_t); c++, cl++) {
    394                         /*
    395                          * Check if the cluster is physically there. This check
    396                          * becomes necessary when the file system is created
    397                          * with fewer total sectors than how many is inferred
    398                          * from the size of the file allocation table.
    399                          */
    400                         if ((cl - 2) * bs->spc + ssa >= ts) {
    401                                 rc = block_put(blk);
    402                                 if (rc != EOK)
    403                                         goto error;
    404                                 goto out;
    405                         }
    406 
    407384                        fat_cluster_t *clst = (fat_cluster_t *)blk->data + c;
    408385                        if (uint16_t_le2host(*clst) == FAT_CLST_RES0) {
     
    442419                }
    443420        }
    444 out:
    445421        fibril_mutex_unlock(&fat_alloc_lock);
    446422
Note: See TracChangeset for help on using the changeset viewer.