Changes in uspace/srv/fs/fat/fat_fat.c [1e4cada:2f636b6] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_fat.c
r1e4cada r2f636b6 46 46 #include <align.h> 47 47 #include <assert.h> 48 #include <fibril_sync h.h>48 #include <fibril_sync.h> 49 49 #include <mem.h> 50 50 … … 359 359 uint16_t rscnt; 360 360 uint16_t sf; 361 uint16_t ts;362 unsigned rde;363 unsigned rds;364 unsigned ssa;365 361 block_t *blk; 366 362 fat_cluster_t *lifo; /* stack for storing free cluster numbers */ … … 376 372 rscnt = uint16_t_le2host(bs->rscnt); 377 373 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;384 374 385 375 /* … … 392 382 goto error; 393 383 for (c = 0; c < bps / sizeof(fat_cluster_t); c++, cl++) { 394 /*395 * Check if the cluster is physically there. This check396 * becomes necessary when the file system is created397 * with fewer total sectors than how many is inferred398 * 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 407 384 fat_cluster_t *clst = (fat_cluster_t *)blk->data + c; 408 385 if (uint16_t_le2host(*clst) == FAT_CLST_RES0) { … … 442 419 } 443 420 } 444 out:445 421 fibril_mutex_unlock(&fat_alloc_lock); 446 422
Note:
See TracChangeset
for help on using the changeset viewer.