Changes in uspace/srv/fs/exfat/exfat_directory.c [92d9406:0dbe5ac] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/exfat/exfat_directory.c
r92d9406 r0dbe5ac 92 92 int rc = EOK; 93 93 94 if (di->b) {94 if (di->b) 95 95 rc = block_put(di->b); 96 di->b = NULL;97 }98 96 99 97 return rc; … … 103 101 { 104 102 uint32_t i; 105 int rc = EOK;103 int rc; 106 104 107 105 i = (di->pos * sizeof(exfat_dentry_t)) / BPS(di->bs); … … 110 108 111 109 if (di->b && di->bnum != i) { 112 rc =block_put(di->b);110 block_put(di->b); 113 111 di->b = NULL; 114 if (rc != EOK)115 return rc;116 112 } 117 113 if (!di->b) { … … 130 126 di->bnum = i; 131 127 } 132 return rc;128 return EOK; 133 129 } 134 130 … … 268 264 if (idx == 2 || idx == 3) 269 265 continue; 270 checksum = ((checksum << 15) | (checksum >> 1)) + 271 (uint16_t)bytes[idx]; 266 checksum = ((checksum << 15) | (checksum >> 1)) + (uint16_t)bytes[idx]; 272 267 } 273 268 return checksum; … … 290 285 for (i = 0; i < count; i++) { 291 286 rc = exfat_directory_get(di, &de); 292 if (rc != EOK) { 293 free(array); 294 return rc; 295 } 287 if (rc != EOK) 288 return rc; 296 289 array[i] = *de; 297 290 rc = exfat_directory_next(di); … … 313 306 array[1].stream.valid_data_size = host2uint64_t_le(ds->valid_data_size); 314 307 array[1].stream.data_size = host2uint64_t_le(ds->data_size); 315 array[0].file.checksum = 316 host2uint16_t_le(exfat_directory_set_checksum((uint8_t *)array, 308 array[0].file.checksum = host2uint16_t_le(exfat_directory_set_checksum((uint8_t *)array, 317 309 count * sizeof(exfat_dentry_t))); 318 310 … … 320 312 for (i = 0; i < count; i++) { 321 313 rc = exfat_directory_get(di, &de); 322 if (rc != EOK) { 323 free(array); 324 return rc; 325 } 314 if (rc != EOK) 315 return rc; 326 316 *de = array[i]; 327 317 di->b->dirty = true; … … 356 346 uctablep = EXFAT_NODE(fn); 357 347 358 uctable_chars = ALIGN_DOWN(uctablep->size, 359 sizeof(uint16_t)) / sizeof(uint16_t); 348 uctable_chars = ALIGN_DOWN(uctablep->size, sizeof(uint16_t)) / sizeof(uint16_t); 360 349 uctable = (uint16_t *) malloc(uctable_chars * sizeof(uint16_t)); 361 350 rc = exfat_read_uctable(di->bs, uctablep, (uint8_t *)uctable); … … 422 411 return rc; 423 412 424 if (i == df.file.count - 2) { 425 chars = ds.stream.name_size - 426 EXFAT_NAME_PART_LEN*(df.file.count - 2); 427 } 428 413 if (i == df.file.count - 2) 414 chars = ds.stream.name_size - EXFAT_NAME_PART_LEN*(df.file.count - 2); 429 415 rc = exfat_directory_get(di, &de); 430 416 if (rc != EOK) … … 438 424 439 425 di->b->dirty = true; 426 sname += chars; 440 427 } 441 428 … … 447 434 int rc, count; 448 435 exfat_dentry_t *de; 449 450 di->pos = pos;451 436 452 437 rc = exfat_directory_get(di, &de);
Note:
See TracChangeset
for help on using the changeset viewer.