Changeset cca29e3c in mainline for uspace/srv/fs/fat/fat_ops.c
- Timestamp:
- 2009-09-03T14:46:17Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2f636b6
- Parents:
- dc87ad11
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_ops.c
rdc87ad11 rcca29e3c 329 329 nodep = fat_node_get_new(); 330 330 if (!nodep) { 331 fat_free_clusters(bs, dev_handle, mcl);331 (void) fat_free_clusters(bs, dev_handle, mcl); 332 332 return NULL; 333 333 } 334 334 idxp = fat_idx_get_new(dev_handle); 335 335 if (!idxp) { 336 fat_free_clusters(bs, dev_handle, mcl);336 (void) fat_free_clusters(bs, dev_handle, mcl); 337 337 fat_node_put(FS_NODE(nodep)); 338 338 return NULL; … … 341 341 if (flags & L_DIRECTORY) { 342 342 /* Populate the new cluster with unused dentries. */ 343 fat_zero_cluster(bs, dev_handle, mcl); 343 rc = fat_zero_cluster(bs, dev_handle, mcl); 344 assert(rc == EOK); 344 345 nodep->type = FAT_DIRECTORY; 345 346 nodep->firstc = mcl; … … 365 366 fat_node_t *nodep = FAT_NODE(fn); 366 367 fat_bs_t *bs; 368 int rc = EOK; 367 369 368 370 /* … … 383 385 assert(nodep->size); 384 386 /* Free all clusters allocated to the node. */ 385 fat_free_clusters(bs, nodep->idx->dev_handle, nodep->firstc); 387 rc = fat_free_clusters(bs, nodep->idx->dev_handle, 388 nodep->firstc); 386 389 } 387 390 … … 389 392 free(nodep->bp); 390 393 free(nodep); 391 return EOK;394 return rc; 392 395 } 393 396 … … 470 473 return rc; 471 474 } 472 fat_zero_cluster(bs, parentp->idx->dev_handle, mcl); 473 fat_append_clusters(bs, parentp, mcl); 475 rc = fat_zero_cluster(bs, parentp->idx->dev_handle, mcl); 476 assert(rc == EOK); 477 rc = fat_append_clusters(bs, parentp, mcl); 478 assert(rc == EOK); 474 479 parentp->size += bps * bs->spc; 475 480 parentp->dirty = true; /* need to sync node */ … … 1088 1093 * next block size boundary. 1089 1094 */ 1090 fat_fill_gap(bs, nodep, FAT_CLST_RES0, pos); 1095 rc = fat_fill_gap(bs, nodep, FAT_CLST_RES0, pos); 1096 assert(rc == EOK); 1091 1097 rc = fat_block_get(&b, bs, nodep, pos / bps, flags); 1092 1098 assert(rc == EOK); … … 1123 1129 } 1124 1130 /* zero fill any gaps */ 1125 fat_fill_gap(bs, nodep, mcl, pos); 1131 rc = fat_fill_gap(bs, nodep, mcl, pos); 1132 assert(rc == EOK); 1126 1133 rc = _fat_block_get(&b, bs, dev_handle, lcl, (pos / bps) % spc, 1127 1134 flags); … … 1136 1143 * node's cluster chain. 1137 1144 */ 1138 fat_append_clusters(bs, nodep, mcl); 1145 rc = fat_append_clusters(bs, nodep, mcl); 1146 assert(rc == EOK); 1139 1147 nodep->size = pos + bytes; 1140 1148 nodep->dirty = true; /* need to sync node */ … … 1189 1197 */ 1190 1198 if (size == 0) { 1191 fat_chop_clusters(bs, nodep, FAT_CLST_RES0); 1199 rc = fat_chop_clusters(bs, nodep, FAT_CLST_RES0); 1200 if (rc != EOK) 1201 goto out; 1192 1202 } else { 1193 1203 fat_cluster_t lastc; … … 1196 1206 if (rc != EOK) 1197 1207 goto out; 1198 fat_chop_clusters(bs, nodep, lastc); 1208 rc = fat_chop_clusters(bs, nodep, lastc); 1209 if (rc != EOK) 1210 goto out; 1199 1211 } 1200 1212 nodep->size = size;
Note:
See TracChangeset
for help on using the changeset viewer.