Changeset a9b756e in mainline for uspace/srv/fs/exfat/exfat_fat.c
- Timestamp:
- 2011-08-16T16:30:27Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ae560da
- Parents:
- 93e12f3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/exfat/exfat_fat.c
r93e12f3 ra9b756e 38 38 39 39 #include "exfat_fat.h" 40 #include "exfat_bitmap.h" 40 41 #include "exfat.h" 41 42 #include "../../vfs/vfs.h" … … 301 302 exfat_cluster_t *lifo; /* stack for storing free cluster numbers */ 302 303 unsigned found = 0; /* top of the free cluster number stack */ 303 exfat_cluster_t clst , value;304 exfat_cluster_t clst; 304 305 int rc = EOK; 305 306 … … 310 311 fibril_mutex_lock(&exfat_alloc_lock); 311 312 for (clst=EXFAT_CLST_FIRST; clst < DATA_CNT(bs)+2 && found < nclsts; clst++) { 312 rc = exfat_get_cluster(bs, devmap_handle, clst, &value); 313 if (rc != EOK) 314 break; 315 316 if (value == 0) { 313 /* Need to rewrite because of multiple exfat_bitmap_get calls */ 314 if (bitmap_is_free(bs, devmap_handle, clst)==EOK) { 317 315 /* 318 316 * The cluster is free. Put it into our stack … … 324 322 if (rc != EOK) 325 323 break; 326 327 324 found++; 325 rc = bitmap_set_cluster(bs, devmap_handle, clst); 326 if (rc != EOK) 327 break; 328 328 329 } 329 330 } … … 339 340 /* If something wrong - free the clusters */ 340 341 if (found > 0) { 341 while (found--) 342 rc = exfat_set_cluster(bs, devmap_handle, lifo[found], 0); 342 while (found--) { 343 (void) bitmap_clear_cluster(bs, devmap_handle, lifo[found]); 344 (void) exfat_set_cluster(bs, devmap_handle, lifo[found], 0); 345 } 343 346 } 344 347
Note:
See TracChangeset
for help on using the changeset viewer.