Changes in uspace/srv/fs/devfs/devfs_ops.c [ffa2c8ef:7ea7db31] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/devfs/devfs_ops.c
rffa2c8ef r7ea7db31 36 36 */ 37 37 38 #include <ipc/ipc.h> 38 39 #include <macros.h> 39 40 #include <bool.h> … … 464 465 0, NULL); 465 466 if (retval != EOK) { 466 async_answer_0(rid, retval);467 ipc_answer_0(rid, retval); 467 468 return; 468 469 } 469 470 470 471 free(opts); 471 async_answer_3(rid, EOK, 0, 0, 0);472 ipc_answer_3(rid, EOK, 0, 0, 0); 472 473 } 473 474 … … 479 480 void devfs_unmounted(ipc_callid_t rid, ipc_call_t *request) 480 481 { 481 async_answer_0(rid, ENOTSUP);482 ipc_answer_0(rid, ENOTSUP); 482 483 } 483 484 … … 512 513 size_t size; 513 514 if (!async_data_read_receive(&callid, &size)) { 514 async_answer_0(callid, EINVAL);515 async_answer_0(rid, EINVAL);515 ipc_answer_0(callid, EINVAL); 516 ipc_answer_0(rid, EINVAL); 516 517 return; 517 518 } … … 534 535 async_data_read_finalize(callid, desc[pos].name, str_size(desc[pos].name) + 1); 535 536 free(desc); 536 async_answer_1(rid, EOK, 1);537 ipc_answer_1(rid, EOK, 1); 537 538 return; 538 539 } … … 549 550 async_data_read_finalize(callid, desc[pos].name, str_size(desc[pos].name) + 1); 550 551 free(desc); 551 async_answer_1(rid, EOK, 1);552 ipc_answer_1(rid, EOK, 1); 552 553 return; 553 554 } … … 556 557 } 557 558 558 async_answer_0(callid, ENOENT);559 async_answer_1(rid, ENOENT, 0);559 ipc_answer_0(callid, ENOENT); 560 ipc_answer_1(rid, ENOENT, 0); 560 561 return; 561 562 } … … 568 569 size_t size; 569 570 if (!async_data_read_receive(&callid, &size)) { 570 async_answer_0(callid, EINVAL);571 async_answer_0(rid, EINVAL);571 ipc_answer_0(callid, EINVAL); 572 ipc_answer_0(rid, EINVAL); 572 573 return; 573 574 } … … 579 580 async_data_read_finalize(callid, desc[pos].name, str_size(desc[pos].name) + 1); 580 581 free(desc); 581 async_answer_1(rid, EOK, 1);582 ipc_answer_1(rid, EOK, 1); 582 583 return; 583 584 } 584 585 585 586 free(desc); 586 async_answer_0(callid, ENOENT);587 async_answer_1(rid, ENOENT, 0);587 ipc_answer_0(callid, ENOENT); 588 ipc_answer_1(rid, ENOENT, 0); 588 589 return; 589 590 } … … 600 601 if (lnk == NULL) { 601 602 fibril_mutex_unlock(&devices_mutex); 602 async_answer_0(rid, ENOENT);603 ipc_answer_0(rid, ENOENT); 603 604 return; 604 605 } … … 610 611 if (!async_data_read_receive(&callid, NULL)) { 611 612 fibril_mutex_unlock(&devices_mutex); 612 async_answer_0(callid, EINVAL);613 async_answer_0(rid, EINVAL);613 ipc_answer_0(callid, EINVAL); 614 ipc_answer_0(rid, EINVAL); 614 615 return; 615 616 } … … 622 623 623 624 /* Forward the IPC_M_DATA_READ request to the driver */ 624 async_forward_fast(callid, dev->phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);625 ipc_forward_fast(callid, dev->phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME); 625 626 fibril_mutex_unlock(&devices_mutex); 626 627 … … 631 632 632 633 /* Driver reply is the final result of the whole operation */ 633 async_answer_1(rid, rc, bytes);634 return; 635 } 636 637 async_answer_0(rid, ENOENT);634 ipc_answer_1(rid, rc, bytes); 635 return; 636 } 637 638 ipc_answer_0(rid, ENOENT); 638 639 } 639 640 … … 642 643 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); 643 644 if (index == 0) { 644 async_answer_0(rid, ENOTSUP);645 ipc_answer_0(rid, ENOTSUP); 645 646 return; 646 647 } … … 650 651 if (type == DEV_HANDLE_NAMESPACE) { 651 652 /* Namespace directory */ 652 async_answer_0(rid, ENOTSUP);653 ipc_answer_0(rid, ENOTSUP); 653 654 return; 654 655 } … … 664 665 if (lnk == NULL) { 665 666 fibril_mutex_unlock(&devices_mutex); 666 async_answer_0(rid, ENOENT);667 ipc_answer_0(rid, ENOENT); 667 668 return; 668 669 } … … 674 675 if (!async_data_write_receive(&callid, NULL)) { 675 676 fibril_mutex_unlock(&devices_mutex); 676 async_answer_0(callid, EINVAL);677 async_answer_0(rid, EINVAL);677 ipc_answer_0(callid, EINVAL); 678 ipc_answer_0(rid, EINVAL); 678 679 return; 679 680 } … … 686 687 687 688 /* Forward the IPC_M_DATA_WRITE request to the driver */ 688 async_forward_fast(callid, dev->phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);689 ipc_forward_fast(callid, dev->phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME); 689 690 690 691 fibril_mutex_unlock(&devices_mutex); … … 696 697 697 698 /* Driver reply is the final result of the whole operation */ 698 async_answer_1(rid, rc, bytes);699 return; 700 } 701 702 async_answer_0(rid, ENOENT);699 ipc_answer_1(rid, rc, bytes); 700 return; 701 } 702 703 ipc_answer_0(rid, ENOENT); 703 704 } 704 705 705 706 void devfs_truncate(ipc_callid_t rid, ipc_call_t *request) 706 707 { 707 async_answer_0(rid, ENOTSUP);708 ipc_answer_0(rid, ENOTSUP); 708 709 } 709 710 … … 713 714 714 715 if (index == 0) { 715 async_answer_0(rid, EOK);716 ipc_answer_0(rid, EOK); 716 717 return; 717 718 } … … 721 722 if (type == DEV_HANDLE_NAMESPACE) { 722 723 /* Namespace directory */ 723 async_answer_0(rid, EOK);724 ipc_answer_0(rid, EOK); 724 725 return; 725 726 } … … 734 735 if (lnk == NULL) { 735 736 fibril_mutex_unlock(&devices_mutex); 736 async_answer_0(rid, ENOENT);737 ipc_answer_0(rid, ENOENT); 737 738 return; 738 739 } … … 743 744 744 745 if (dev->refcount == 0) { 745 async_hangup(dev->phone);746 ipc_hangup(dev->phone); 746 747 hash_table_remove(&devices, key, DEVICES_KEYS); 747 748 } … … 749 750 fibril_mutex_unlock(&devices_mutex); 750 751 751 async_answer_0(rid, EOK);752 return; 753 } 754 755 async_answer_0(rid, ENOENT);752 ipc_answer_0(rid, EOK); 753 return; 754 } 755 756 ipc_answer_0(rid, ENOENT); 756 757 } 757 758 … … 761 762 762 763 if (index == 0) { 763 async_answer_0(rid, EOK);764 ipc_answer_0(rid, EOK); 764 765 return; 765 766 } … … 769 770 if (type == DEV_HANDLE_NAMESPACE) { 770 771 /* Namespace directory */ 771 async_answer_0(rid, EOK);772 ipc_answer_0(rid, EOK); 772 773 return; 773 774 } … … 782 783 if (lnk == NULL) { 783 784 fibril_mutex_unlock(&devices_mutex); 784 async_answer_0(rid, ENOENT);785 ipc_answer_0(rid, ENOENT); 785 786 return; 786 787 } … … 801 802 802 803 /* Driver reply is the final result of the whole operation */ 803 async_answer_0(rid, rc);804 return; 805 } 806 807 async_answer_0(rid, ENOENT);804 ipc_answer_0(rid, rc); 805 return; 806 } 807 808 ipc_answer_0(rid, ENOENT); 808 809 } 809 810 810 811 void devfs_destroy(ipc_callid_t rid, ipc_call_t *request) 811 812 { 812 async_answer_0(rid, ENOTSUP);813 ipc_answer_0(rid, ENOTSUP); 813 814 } 814 815
Note:
See TracChangeset
for help on using the changeset viewer.