Changeset 383ddd6 in mainline for uspace/srv/fs/fat/fat_fat.c
- Timestamp:
- 2010-01-20T20:33:55Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 975e7e9
- Parents:
- 6c01702 (diff), 3c081d0e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_fat.c
r6c01702 r383ddd6 247 247 */ 248 248 int 249 fat_get_cluster(fat_bs_t *bs, dev_handle_t dev_handle, fat_cluster_t clst,250 fat_cluster_t *value)249 fat_get_cluster(fat_bs_t *bs, dev_handle_t dev_handle, unsigned fatno, 250 fat_cluster_t clst, fat_cluster_t *value) 251 251 { 252 252 block_t *b; 253 253 uint16_t bps; 254 254 uint16_t rscnt; 255 uint16_t sf; 255 256 fat_cluster_t *cp; 256 257 int rc; … … 258 259 bps = uint16_t_le2host(bs->bps); 259 260 rscnt = uint16_t_le2host(bs->rscnt); 260 261 rc = block_get(&b, dev_handle, rscnt + 261 sf = uint16_t_le2host(bs->sec_per_fat); 262 263 rc = block_get(&b, dev_handle, rscnt + sf * fatno + 262 264 (clst * sizeof(fat_cluster_t)) / bps, BLOCK_FLAGS_NONE); 263 265 if (rc != EOK) … … 398 400 * from the size of the file allocation table. 399 401 */ 400 if ((cl - 2) * bs->spc + ssa >= ts) {402 if ((cl >= 2) && ((cl - 2) * bs->spc + ssa >= ts)) { 401 403 rc = block_put(blk); 402 404 if (rc != EOK) … … 480 482 while (firstc < FAT_CLST_LAST1) { 481 483 assert(firstc >= FAT_CLST_FIRST && firstc < FAT_CLST_BAD); 482 rc = fat_get_cluster(bs, dev_handle, firstc, &nextc);484 rc = fat_get_cluster(bs, dev_handle, FAT1, firstc, &nextc); 483 485 if (rc != EOK) 484 486 return rc; … … 560 562 unsigned fatno; 561 563 562 rc = fat_get_cluster(bs, dev_handle, lastc, &nextc);564 rc = fat_get_cluster(bs, dev_handle, FAT1, lastc, &nextc); 563 565 if (rc != EOK) 564 566 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.