Changes in uspace/srv/fs/tmpfs/tmpfs_ops.c [ffa2c8ef:991f645] in mainline
- File:
-
- 1 edited
-
uspace/srv/fs/tmpfs/tmpfs_ops.c (modified) (22 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/tmpfs/tmpfs_ops.c
rffa2c8ef r991f645 39 39 #include "tmpfs.h" 40 40 #include "../../vfs/vfs.h" 41 #include <ipc/ipc.h> 41 42 #include <macros.h> 42 43 #include <stdint.h> … … 449 450 rc = async_data_write_accept((void **) &opts, true, 0, 0, 0, NULL); 450 451 if (rc != EOK) { 451 async_answer_0(rid, rc);452 ipc_answer_0(rid, rc); 452 453 return; 453 454 } … … 458 459 (void) tmpfs_node_put(rootfn); 459 460 free(opts); 460 async_answer_0(rid, EEXIST);461 ipc_answer_0(rid, EEXIST); 461 462 return; 462 463 } … … 465 466 if (!tmpfs_instance_init(devmap_handle)) { 466 467 free(opts); 467 async_answer_0(rid, ENOMEM);468 ipc_answer_0(rid, ENOMEM); 468 469 return; 469 470 } … … 474 475 if (str_cmp(opts, "restore") == 0) { 475 476 if (tmpfs_restore(devmap_handle)) 476 async_answer_3(rid, EOK, rootp->index, rootp->size,477 ipc_answer_3(rid, EOK, rootp->index, rootp->size, 477 478 rootp->lnkcnt); 478 479 else 479 async_answer_0(rid, ELIMIT);480 ipc_answer_0(rid, ELIMIT); 480 481 } else { 481 async_answer_3(rid, EOK, rootp->index, rootp->size,482 ipc_answer_3(rid, EOK, rootp->index, rootp->size, 482 483 rootp->lnkcnt); 483 484 } … … 495 496 496 497 tmpfs_instance_done(devmap_handle); 497 async_answer_0(rid, EOK);498 ipc_answer_0(rid, EOK); 498 499 } 499 500 … … 525 526 hlp = hash_table_find(&nodes, key); 526 527 if (!hlp) { 527 async_answer_0(rid, ENOENT);528 ipc_answer_0(rid, ENOENT); 528 529 return; 529 530 } … … 537 538 size_t size; 538 539 if (!async_data_read_receive(&callid, &size)) { 539 async_answer_0(callid, EINVAL);540 async_answer_0(rid, EINVAL);540 ipc_answer_0(callid, EINVAL); 541 ipc_answer_0(rid, EINVAL); 541 542 return; 542 543 } … … 565 566 566 567 if (lnk == &nodep->cs_head) { 567 async_answer_0(callid, ENOENT);568 async_answer_1(rid, ENOENT, 0);568 ipc_answer_0(callid, ENOENT); 569 ipc_answer_1(rid, ENOENT, 0); 569 570 return; 570 571 } … … 580 581 * Answer the VFS_READ call. 581 582 */ 582 async_answer_1(rid, EOK, bytes);583 ipc_answer_1(rid, EOK, bytes); 583 584 } 584 585 … … 600 601 hlp = hash_table_find(&nodes, key); 601 602 if (!hlp) { 602 async_answer_0(rid, ENOENT);603 ipc_answer_0(rid, ENOENT); 603 604 return; 604 605 } … … 612 613 size_t size; 613 614 if (!async_data_write_receive(&callid, &size)) { 614 async_answer_0(callid, EINVAL);615 async_answer_0(rid, EINVAL);615 ipc_answer_0(callid, EINVAL); 616 ipc_answer_0(rid, EINVAL); 616 617 return; 617 618 } … … 623 624 /* The file size is not changing. */ 624 625 (void) async_data_write_finalize(callid, nodep->data + pos, size); 625 async_answer_2(rid, EOK, size, nodep->size);626 ipc_answer_2(rid, EOK, size, nodep->size); 626 627 return; 627 628 } … … 636 637 void *newdata = realloc(nodep->data, nodep->size + delta); 637 638 if (!newdata) { 638 async_answer_0(callid, ENOMEM);639 async_answer_2(rid, EOK, 0, nodep->size);639 ipc_answer_0(callid, ENOMEM); 640 ipc_answer_2(rid, EOK, 0, nodep->size); 640 641 return; 641 642 } … … 645 646 nodep->data = newdata; 646 647 (void) async_data_write_finalize(callid, nodep->data + pos, size); 647 async_answer_2(rid, EOK, size, nodep->size);648 ipc_answer_2(rid, EOK, size, nodep->size); 648 649 } 649 650 … … 664 665 link_t *hlp = hash_table_find(&nodes, key); 665 666 if (!hlp) { 666 async_answer_0(rid, ENOENT);667 ipc_answer_0(rid, ENOENT); 667 668 return; 668 669 } … … 671 672 672 673 if (size == nodep->size) { 673 async_answer_0(rid, EOK);674 ipc_answer_0(rid, EOK); 674 675 return; 675 676 } 676 677 677 678 if (size > SIZE_MAX) { 678 async_answer_0(rid, ENOMEM);679 ipc_answer_0(rid, ENOMEM); 679 680 return; 680 681 } … … 682 683 void *newdata = realloc(nodep->data, size); 683 684 if (!newdata) { 684 async_answer_0(rid, ENOMEM);685 ipc_answer_0(rid, ENOMEM); 685 686 return; 686 687 } … … 693 694 nodep->size = size; 694 695 nodep->data = newdata; 695 async_answer_0(rid, EOK);696 ipc_answer_0(rid, EOK); 696 697 } 697 698 698 699 void tmpfs_close(ipc_callid_t rid, ipc_call_t *request) 699 700 { 700 async_answer_0(rid, EOK);701 ipc_answer_0(rid, EOK); 701 702 } 702 703 … … 714 715 hlp = hash_table_find(&nodes, key); 715 716 if (!hlp) { 716 async_answer_0(rid, ENOENT);717 ipc_answer_0(rid, ENOENT); 717 718 return; 718 719 } … … 720 721 nh_link); 721 722 rc = tmpfs_destroy_node(FS_NODE(nodep)); 722 async_answer_0(rid, rc);723 ipc_answer_0(rid, rc); 723 724 } 724 725 … … 739 740 * thus the sync operation is a no-op. 740 741 */ 741 async_answer_0(rid, EOK);742 ipc_answer_0(rid, EOK); 742 743 } 743 744
Note:
See TracChangeset
for help on using the changeset viewer.
