Changeset 7ece4247 in mainline
- Timestamp:
- 2011-08-26T23:36:00Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0be611b
- Parents:
- 4bf6895
- Location:
- uspace/srv/fs/fat
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_fat.c
r4bf6895 r7ece4247 289 289 * @return EOK or a negative error code. 290 290 */ 291 int291 static int 292 292 fat_get_cluster_fat12(fat_bs_t *bs, service_id_t service_id, unsigned fatno, 293 293 fat_cluster_t clst, fat_cluster_t *value) … … 359 359 * @return EOK or a negative error code. 360 360 */ 361 int361 static int 362 362 fat_get_cluster_fat16(fat_bs_t *bs, service_id_t service_id, unsigned fatno, 363 363 fat_cluster_t clst, fat_cluster_t *value) … … 390 390 * @return EOK or a negative error code. 391 391 */ 392 int392 static int 393 393 fat_get_cluster_fat32(fat_bs_t *bs, service_id_t service_id, unsigned fatno, 394 394 fat_cluster_t clst, fat_cluster_t *value) … … 451 451 * @return EOK on success or a negative error code. 452 452 */ 453 int453 static int 454 454 fat_set_cluster_fat12(fat_bs_t *bs, service_id_t service_id, unsigned fatno, 455 455 fat_cluster_t clst, fat_cluster_t value) … … 494 494 return ERANGE; 495 495 } 496 } 497 else 496 } else 498 497 byte2 = ((uint8_t*) b->data)[(offset % BPS(bs)) + 1]; 499 498 … … 540 539 * @return EOK on success or a negative error code. 541 540 */ 542 int541 static int 543 542 fat_set_cluster_fat16(fat_bs_t *bs, service_id_t service_id, unsigned fatno, 544 543 fat_cluster_t clst, fat_cluster_t value) … … 573 572 * @return EOK on success or a negative error code. 574 573 */ 575 int574 static int 576 575 fat_set_cluster_fat32(fat_bs_t *bs, service_id_t service_id, unsigned fatno, 577 576 fat_cluster_t clst, fat_cluster_t value) -
uspace/srv/fs/fat/fat_fat.h
r4bf6895 r7ece4247 125 125 extern int fat_alloc_shadow_clusters(struct fat_bs *, service_id_t, 126 126 fat_cluster_t *, unsigned); 127 extern int fat_get_cluster_fat12(struct fat_bs *, service_id_t, unsigned,128 fat_cluster_t, fat_cluster_t *);129 extern int fat_get_cluster_fat16(struct fat_bs *, service_id_t, unsigned,130 fat_cluster_t, fat_cluster_t *);131 extern int fat_get_cluster_fat32(struct fat_bs *, service_id_t, unsigned,132 fat_cluster_t, fat_cluster_t *);133 127 extern int fat_get_cluster(struct fat_bs *, service_id_t, unsigned, 134 128 fat_cluster_t, fat_cluster_t *); 135 extern int fat_set_cluster_fat12(struct fat_bs *, service_id_t, unsigned,136 fat_cluster_t, fat_cluster_t);137 extern int fat_set_cluster_fat16(struct fat_bs *, service_id_t, unsigned,138 fat_cluster_t, fat_cluster_t);139 extern int fat_set_cluster_fat32(struct fat_bs *, service_id_t, unsigned,140 fat_cluster_t, fat_cluster_t);141 129 extern int fat_set_cluster(struct fat_bs *, service_id_t, unsigned, 142 130 fat_cluster_t, fat_cluster_t); -
uspace/srv/fs/fat/fat_ops.c
r4bf6895 r7ece4247 315 315 nodep->firstc = uint16_t_le2host(d->firstc_lo) | 316 316 (uint16_t_le2host(d->firstc_hi) << 16); 317 } 318 else 317 } else 319 318 nodep->firstc = uint16_t_le2host(d->firstc); 320 319 … … 333 332 */ 334 333 uint32_t clusters; 335 rc = fat_clusters_get(&clusters, bs, idxp->service_id, nodep->firstc); 334 rc = fat_clusters_get(&clusters, bs, idxp->service_id, 335 nodep->firstc); 336 336 if (rc != EOK) { 337 337 (void) block_put(b); … … 392 392 /* hit */ 393 393 fat_node_t *nodep; 394 aoff64_t o = di.pos % (BPS(di.bs) / sizeof(fat_dentry_t)); 394 aoff64_t o = di.pos % 395 (BPS(di.bs) / sizeof(fat_dentry_t)); 395 396 fat_idx_t *idx = fat_idx_get_by_pos(service_id, 396 397 parentp->firstc, di.bnum * DPS(di.bs) + o); 397 398 if (!idx) { 398 399 /* … … 615 616 616 617 rc = fat_directory_write(&di, name, &de); 617 if (rc !=EOK)618 if (rc != EOK) 618 619 return rc; 619 620 rc = fat_directory_close(&di); 620 if (rc !=EOK)621 if (rc != EOK) 621 622 return rc; 622 623 … … 713 714 714 715 fat_directory_t di; 715 rc = fat_directory_open(parentp, &di);716 rc = fat_directory_open(parentp, &di); 716 717 if (rc != EOK) 717 718 goto error; … … 1089 1090 fat_directory_t di; 1090 1091 rc = fat_directory_open(nodep, &di); 1091 if (rc != EOK) goto err; 1092 if (rc != EOK) 1093 goto err; 1092 1094 rc = fat_directory_seek(&di, pos); 1093 1095 if (rc != EOK) { … … 1097 1099 1098 1100 rc = fat_directory_read(&di, name, &d); 1099 if (rc == EOK) goto hit; 1100 if (rc == ENOENT) goto miss; 1101 if (rc == EOK) 1102 goto hit; 1103 if (rc == ENOENT) 1104 goto miss; 1101 1105 1102 1106 err: … … 1107 1111 miss: 1108 1112 rc = fat_directory_close(&di); 1109 if (rc !=EOK)1113 if (rc != EOK) 1110 1114 goto err; 1111 1115 rc = fat_node_put(fn); … … 1117 1121 pos = di.pos; 1118 1122 rc = fat_directory_close(&di); 1119 if (rc !=EOK)1123 if (rc != EOK) 1120 1124 goto err; 1121 (void) async_data_read_finalize(callid, name, str_size(name) + 1); 1122 bytes = (pos - spos)+1; 1125 (void) async_data_read_finalize(callid, name, 1126 str_size(name) + 1); 1127 bytes = (pos - spos) + 1; 1123 1128 } 1124 1129
Note:
See TracChangeset
for help on using the changeset viewer.