Changeset c56c4576 in mainline
- Timestamp:
- 2011-08-18T18:09:11Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7234617
- Parents:
- 602c3d8c
- Location:
- uspace/srv/fs/exfat
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/exfat/exfat_directory.c
r602c3d8c rc56c4576 283 283 if (rc != EOK) 284 284 return rc; 285 memcpy((uint8_t *)&array[i], (uint8_t *)de, sizeof(exfat_dentry_t));285 array[i] = *de; 286 286 rc = exfat_directory_next(di); 287 287 if (rc!=EOK) { … … 297 297 298 298 /* Sync */ 299 array[0].file.attr = df->attr;300 array[1].stream.firstc = ds->firstc;299 array[0].file.attr = host2uint16_t_le(df->attr); 300 array[1].stream.firstc = host2uint32_t_le(ds->firstc); 301 301 array[1].stream.flags = ds->flags; 302 array[1].stream.valid_data_size = ds->valid_data_size;303 array[1].stream.data_size = ds->data_size;302 array[1].stream.valid_data_size = host2uint64_t_le(ds->valid_data_size); 303 array[1].stream.data_size = host2uint64_t_le(ds->data_size); 304 304 array[0].file.checksum = host2uint16_t_le(exfat_directory_set_checksum((uint8_t *)array, 305 305 count*sizeof(exfat_dentry_t))); … … 310 310 if (rc != EOK) 311 311 return rc; 312 memcpy((uint8_t *)de, (uint8_t *)&array[i], sizeof(exfat_dentry_t));312 *de = array[i]; 313 313 di->b->dirty = true; 314 314 rc = exfat_directory_next(di); … … 318 318 } 319 319 } 320 free(array); 320 321 321 322 return EOK; … … 369 370 uint16_t wname[EXFAT_FILENAME_LEN+1]; 370 371 int rc, i; 371 size_t uctable_chars ;372 size_t uctable_chars, j; 372 373 aoff64_t pos; 373 374 … … 420 421 if (rc != EOK) 421 422 return rc; 422 memcpy(de, &df, sizeof(exfat_dentry_t));423 *de = df; 423 424 di->b->dirty = true; 424 425 rc = exfat_directory_next(di); … … 430 431 if (rc != EOK) 431 432 return rc; 432 memcpy(de, &ds, sizeof(exfat_dentry_t));433 *de = ds; 433 434 di->b->dirty = true; 434 435 … … 451 452 return rc; 452 453 de->type = EXFAT_TYPE_NAME; 453 memcpy((uint8_t*)de->name.name, (uint8_t*)sname, sizeof(uint16_t)*chars); 454 /* test */ 455 for (j=0; j<chars; j++){ 456 de->name.name[j] = *sname; 457 sname++; 458 } 459 454 460 di->b->dirty = true; 455 461 sname += chars; -
uspace/srv/fs/exfat/exfat_ops.c
r602c3d8c rc56c4576 125 125 df.attr = 0; 126 126 127 ds.firstc = host2uint32_t_le(node->firstc);127 ds.firstc = node->firstc; 128 128 if (node->size == 0 && node->firstc == 0) { 129 129 ds.flags = 0; … … 132 132 ds.flags |= (!node->fragmented << 1); 133 133 } 134 ds.valid_data_size = host2uint64_t_le(node->size);135 ds.data_size = host2uint64_t_le(node->size);134 ds.valid_data_size = node->size; 135 ds.data_size = node->size; 136 136 137 137 exfat_directory_open_parent(&di, node->idx->devmap_handle, node->idx->pfc, … … 335 335 switch (exfat_classify_dentry(d)) { 336 336 case EXFAT_DENTRY_FILE: 337 nodep->type = ( d->file.attr& EXFAT_ATTR_SUBDIR)?337 nodep->type = (uint16_t_le2host(d->file.attr) & EXFAT_ATTR_SUBDIR)? 338 338 EXFAT_DIRECTORY : EXFAT_FILE; 339 339 rc = exfat_directory_next(&di); … … 349 349 return rc; 350 350 } 351 nodep->firstc = d->stream.firstc;352 nodep->size = d->stream.data_size;351 nodep->firstc = uint32_t_le2host(d->stream.firstc); 352 nodep->size = uint64_t_le2host(d->stream.data_size); 353 353 nodep->fragmented = (d->stream.flags & 0x02) == 0; 354 354 break; 355 355 case EXFAT_DENTRY_BITMAP: 356 356 nodep->type = EXFAT_BITMAP; 357 nodep->firstc = d->bitmap.firstc;358 nodep->size = d->bitmap.size;357 nodep->firstc = uint32_t_le2host(d->bitmap.firstc); 358 nodep->size = uint64_t_le2host(d->bitmap.size); 359 359 nodep->fragmented = true; 360 360 break; 361 361 case EXFAT_DENTRY_UCTABLE: 362 362 nodep->type = EXFAT_UCTABLE; 363 nodep->firstc = d->uctable.firstc;364 nodep->size = d->uctable.size;363 nodep->firstc = uint32_t_le2host(d->uctable.firstc); 364 nodep->size = uint64_t_le2host(d->uctable.size); 365 365 nodep->fragmented = true; 366 366 break; … … 1074 1074 1075 1075 bitmapp->type = EXFAT_BITMAP; 1076 bitmapp->firstc = de->bitmap.firstc;1076 bitmapp->firstc = uint32_t_le2host(de->bitmap.firstc); 1077 1077 bitmapp->fragmented = true; 1078 1078 bitmapp->idx->parent_fragmented = true; 1079 1079 bitmapp->refcnt = 1; 1080 1080 bitmapp->lnkcnt = 0; 1081 bitmapp->size = de->bitmap.size;1081 bitmapp->size = uint64_t_le2host(de->bitmap.size); 1082 1082 1083 1083 /* Initialize the uctable node. */ … … 1116 1116 1117 1117 uctablep->type = EXFAT_UCTABLE; 1118 uctablep->firstc = de->uctable.firstc;1118 uctablep->firstc = uint32_t_le2host(de->uctable.firstc); 1119 1119 uctablep->fragmented = true; 1120 1120 uctablep->idx->parent_fragmented = true; 1121 1121 uctablep->refcnt = 1; 1122 1122 uctablep->lnkcnt = 0; 1123 uctablep->size = de->uctable.size;1123 uctablep->size = uint64_t_le2host(de->uctable.size); 1124 1124 1125 1125 rc = exfat_directory_close(&di);
Note:
See TracChangeset
for help on using the changeset viewer.