Changeset a46e56b in mainline for uspace/srv/fs/tmpfs/tmpfs_ops.c
- Timestamp:
- 2018-03-22T06:49:35Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 77f0a1d
- Parents:
- 3e242d2
- git-author:
- Jakub Jermar <jakub@…> (2018-03-21 23:29:06)
- git-committer:
- Jakub Jermar <jakub@…> (2018-03-22 06:49:35)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/tmpfs/tmpfs_ops.c
r3e242d2 ra46e56b 484 484 * Receive the read request. 485 485 */ 486 cap_call_handle_t c allid;486 cap_call_handle_t chandle; 487 487 size_t size; 488 if (!async_data_read_receive(&c allid, &size)) {489 async_answer_0(c allid, EINVAL);488 if (!async_data_read_receive(&chandle, &size)) { 489 async_answer_0(chandle, EINVAL); 490 490 return EINVAL; 491 491 } … … 494 494 if (nodep->type == TMPFS_FILE) { 495 495 bytes = min(nodep->size - pos, size); 496 (void) async_data_read_finalize(c allid, nodep->data + pos,496 (void) async_data_read_finalize(chandle, nodep->data + pos, 497 497 bytes); 498 498 } else { … … 510 510 511 511 if (lnk == NULL) { 512 async_answer_0(c allid, ENOENT);512 async_answer_0(chandle, ENOENT); 513 513 return ENOENT; 514 514 } … … 516 516 dentryp = list_get_instance(lnk, tmpfs_dentry_t, link); 517 517 518 (void) async_data_read_finalize(c allid, dentryp->name,518 (void) async_data_read_finalize(chandle, dentryp->name, 519 519 str_size(dentryp->name) + 1); 520 520 bytes = 1; … … 547 547 * Receive the write request. 548 548 */ 549 cap_call_handle_t c allid;549 cap_call_handle_t chandle; 550 550 size_t size; 551 if (!async_data_write_receive(&c allid, &size)) {552 async_answer_0(c allid, EINVAL);551 if (!async_data_write_receive(&chandle, &size)) { 552 async_answer_0(chandle, EINVAL); 553 553 return EINVAL; 554 554 } … … 559 559 if (pos + size <= nodep->size) { 560 560 /* The file size is not changing. */ 561 (void) async_data_write_finalize(c allid, nodep->data + pos,561 (void) async_data_write_finalize(chandle, nodep->data + pos, 562 562 size); 563 563 goto out; … … 573 573 void *newdata = realloc(nodep->data, nodep->size + delta); 574 574 if (!newdata) { 575 async_answer_0(c allid, ENOMEM);575 async_answer_0(chandle, ENOMEM); 576 576 size = 0; 577 577 goto out; … … 581 581 nodep->size += delta; 582 582 nodep->data = newdata; 583 (void) async_data_write_finalize(c allid, nodep->data + pos, size);583 (void) async_data_write_finalize(chandle, nodep->data + pos, size); 584 584 585 585 out:
Note:
See TracChangeset
for help on using the changeset viewer.