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