Changeset 7d78d163 in mainline
- Timestamp:
- 2011-08-15T17:20:15Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9558eaa
- Parents:
- 8a06c1b
- Location:
- uspace/srv/fs/exfat
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/exfat/exfat_directory.c
r8a06c1b r7d78d163 351 351 } 352 352 353 int exfat_directory_expand(exfat_directory_t *di) 354 { 355 int rc; 356 357 if (!di->nodep) 358 return ENOSPC; 359 360 rc = exfat_node_expand(di->nodep->idx->devmap_handle, di->nodep, 1); 361 if (rc != EOK) 362 return rc; 363 364 di->fragmented = di->nodep->fragmented; 365 di->nodep->size += BPC(di->bs); 366 di->nodep->dirty = true; /* need to sync node */ 367 di->blocks = di->nodep->size / BPS(di->bs); 368 369 return EOK; 370 } 371 372 int exfat_directory_lookup_free(exfat_directory_t *di, size_t count) 373 { 374 int rc; 375 exfat_dentry_t *d; 376 size_t found; 377 aoff64_t pos; 378 379 rc = exfat_directory_seek(di, 0); 380 if (rc != EOK) 381 return rc; 382 383 do { 384 found = 0; 385 pos = 0; 386 do { 387 if (exfat_directory_get(di, &d) == EOK) { 388 switch (exfat_classify_dentry(d)) { 389 case EXFAT_DENTRY_LAST: 390 case EXFAT_DENTRY_FREE: 391 if (found==0) pos = di->pos; 392 found++; 393 if (found == count) { 394 exfat_directory_seek(di, pos); 395 return EOK; 396 } 397 break; 398 default: 399 found = 0; 400 break; 401 } 402 } 403 } while (exfat_directory_next(di) == EOK); 404 } while (exfat_directory_expand(di) == EOK); 405 return ENOSPC; 406 } 407 353 408 354 409 /** -
uspace/srv/fs/exfat/exfat_directory.h
r8a06c1b r7d78d163 76 76 extern int exfat_directory_erase_file(exfat_directory_t *di, aoff64_t pos); 77 77 78 /*79 78 extern int exfat_directory_expand(exfat_directory_t *di); 80 79 extern int exfat_directory_lookup_free(exfat_directory_t *di, size_t count); 81 */ 80 82 81 83 82 #endif
Note:
See TracChangeset
for help on using the changeset viewer.