Changeset 8b5690f in mainline for uspace/srv/fs/devfs/devfs_ops.c
- Timestamp:
- 2011-02-03T05:11:01Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ba38f72c
- Parents:
- 22027b6e (diff), 86d7bfa (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
r22027b6e r8b5690f 36 36 */ 37 37 38 #include <ipc/ipc.h>39 38 #include <macros.h> 40 39 #include <bool.h> … … 454 453 return false; 455 454 456 if (devmap_get_phone(DEVMAP_CLIENT, IPC_FLAG_BLOCKING) < 0)457 return false;458 459 455 return true; 460 456 } … … 468 464 0, NULL); 469 465 if (retval != EOK) { 470 ipc_answer_0(rid, retval);466 async_answer_0(rid, retval); 471 467 return; 472 468 } 473 469 474 470 free(opts); 475 ipc_answer_3(rid, EOK, 0, 0, 0);471 async_answer_3(rid, EOK, 0, 0, 0); 476 472 } 477 473 … … 483 479 void devfs_unmounted(ipc_callid_t rid, ipc_call_t *request) 484 480 { 485 ipc_answer_0(rid, ENOTSUP);481 async_answer_0(rid, ENOTSUP); 486 482 } 487 483 … … 516 512 size_t size; 517 513 if (!async_data_read_receive(&callid, &size)) { 518 ipc_answer_0(callid, EINVAL);519 ipc_answer_0(rid, EINVAL);514 async_answer_0(callid, EINVAL); 515 async_answer_0(rid, EINVAL); 520 516 return; 521 517 } … … 538 534 async_data_read_finalize(callid, desc[pos].name, str_size(desc[pos].name) + 1); 539 535 free(desc); 540 ipc_answer_1(rid, EOK, 1);536 async_answer_1(rid, EOK, 1); 541 537 return; 542 538 } … … 553 549 async_data_read_finalize(callid, desc[pos].name, str_size(desc[pos].name) + 1); 554 550 free(desc); 555 ipc_answer_1(rid, EOK, 1);551 async_answer_1(rid, EOK, 1); 556 552 return; 557 553 } … … 560 556 } 561 557 562 ipc_answer_0(callid, ENOENT);563 ipc_answer_1(rid, ENOENT, 0);558 async_answer_0(callid, ENOENT); 559 async_answer_1(rid, ENOENT, 0); 564 560 return; 565 561 } … … 572 568 size_t size; 573 569 if (!async_data_read_receive(&callid, &size)) { 574 ipc_answer_0(callid, EINVAL);575 ipc_answer_0(rid, EINVAL);570 async_answer_0(callid, EINVAL); 571 async_answer_0(rid, EINVAL); 576 572 return; 577 573 } … … 583 579 async_data_read_finalize(callid, desc[pos].name, str_size(desc[pos].name) + 1); 584 580 free(desc); 585 ipc_answer_1(rid, EOK, 1);581 async_answer_1(rid, EOK, 1); 586 582 return; 587 583 } 588 584 589 585 free(desc); 590 ipc_answer_0(callid, ENOENT);591 ipc_answer_1(rid, ENOENT, 0);586 async_answer_0(callid, ENOENT); 587 async_answer_1(rid, ENOENT, 0); 592 588 return; 593 589 } … … 604 600 if (lnk == NULL) { 605 601 fibril_mutex_unlock(&devices_mutex); 606 ipc_answer_0(rid, ENOENT);602 async_answer_0(rid, ENOENT); 607 603 return; 608 604 } … … 614 610 if (!async_data_read_receive(&callid, NULL)) { 615 611 fibril_mutex_unlock(&devices_mutex); 616 ipc_answer_0(callid, EINVAL);617 ipc_answer_0(rid, EINVAL);612 async_answer_0(callid, EINVAL); 613 async_answer_0(rid, EINVAL); 618 614 return; 619 615 } … … 626 622 627 623 /* Forward the IPC_M_DATA_READ request to the driver */ 628 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); 629 625 fibril_mutex_unlock(&devices_mutex); 630 626 … … 635 631 636 632 /* Driver reply is the final result of the whole operation */ 637 ipc_answer_1(rid, rc, bytes);638 return; 639 } 640 641 ipc_answer_0(rid, ENOENT);633 async_answer_1(rid, rc, bytes); 634 return; 635 } 636 637 async_answer_0(rid, ENOENT); 642 638 } 643 639 … … 646 642 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); 647 643 if (index == 0) { 648 ipc_answer_0(rid, ENOTSUP);644 async_answer_0(rid, ENOTSUP); 649 645 return; 650 646 } … … 654 650 if (type == DEV_HANDLE_NAMESPACE) { 655 651 /* Namespace directory */ 656 ipc_answer_0(rid, ENOTSUP);652 async_answer_0(rid, ENOTSUP); 657 653 return; 658 654 } … … 668 664 if (lnk == NULL) { 669 665 fibril_mutex_unlock(&devices_mutex); 670 ipc_answer_0(rid, ENOENT);666 async_answer_0(rid, ENOENT); 671 667 return; 672 668 } … … 678 674 if (!async_data_write_receive(&callid, NULL)) { 679 675 fibril_mutex_unlock(&devices_mutex); 680 ipc_answer_0(callid, EINVAL);681 ipc_answer_0(rid, EINVAL);676 async_answer_0(callid, EINVAL); 677 async_answer_0(rid, EINVAL); 682 678 return; 683 679 } … … 690 686 691 687 /* Forward the IPC_M_DATA_WRITE request to the driver */ 692 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); 693 689 694 690 fibril_mutex_unlock(&devices_mutex); … … 700 696 701 697 /* Driver reply is the final result of the whole operation */ 702 ipc_answer_1(rid, rc, bytes);703 return; 704 } 705 706 ipc_answer_0(rid, ENOENT);698 async_answer_1(rid, rc, bytes); 699 return; 700 } 701 702 async_answer_0(rid, ENOENT); 707 703 } 708 704 709 705 void devfs_truncate(ipc_callid_t rid, ipc_call_t *request) 710 706 { 711 ipc_answer_0(rid, ENOTSUP);707 async_answer_0(rid, ENOTSUP); 712 708 } 713 709 … … 717 713 718 714 if (index == 0) { 719 ipc_answer_0(rid, EOK);715 async_answer_0(rid, EOK); 720 716 return; 721 717 } … … 725 721 if (type == DEV_HANDLE_NAMESPACE) { 726 722 /* Namespace directory */ 727 ipc_answer_0(rid, EOK);723 async_answer_0(rid, EOK); 728 724 return; 729 725 } … … 738 734 if (lnk == NULL) { 739 735 fibril_mutex_unlock(&devices_mutex); 740 ipc_answer_0(rid, ENOENT);736 async_answer_0(rid, ENOENT); 741 737 return; 742 738 } … … 747 743 748 744 if (dev->refcount == 0) { 749 ipc_hangup(dev->phone);745 async_hangup(dev->phone); 750 746 hash_table_remove(&devices, key, DEVICES_KEYS); 751 747 } … … 753 749 fibril_mutex_unlock(&devices_mutex); 754 750 755 ipc_answer_0(rid, EOK);756 return; 757 } 758 759 ipc_answer_0(rid, ENOENT);751 async_answer_0(rid, EOK); 752 return; 753 } 754 755 async_answer_0(rid, ENOENT); 760 756 } 761 757 … … 765 761 766 762 if (index == 0) { 767 ipc_answer_0(rid, EOK);763 async_answer_0(rid, EOK); 768 764 return; 769 765 } … … 773 769 if (type == DEV_HANDLE_NAMESPACE) { 774 770 /* Namespace directory */ 775 ipc_answer_0(rid, EOK);771 async_answer_0(rid, EOK); 776 772 return; 777 773 } … … 786 782 if (lnk == NULL) { 787 783 fibril_mutex_unlock(&devices_mutex); 788 ipc_answer_0(rid, ENOENT);784 async_answer_0(rid, ENOENT); 789 785 return; 790 786 } … … 805 801 806 802 /* Driver reply is the final result of the whole operation */ 807 ipc_answer_0(rid, rc);808 return; 809 } 810 811 ipc_answer_0(rid, ENOENT);803 async_answer_0(rid, rc); 804 return; 805 } 806 807 async_answer_0(rid, ENOENT); 812 808 } 813 809 814 810 void devfs_destroy(ipc_callid_t rid, ipc_call_t *request) 815 811 { 816 ipc_answer_0(rid, ENOTSUP);812 async_answer_0(rid, ENOTSUP); 817 813 } 818 814
Note:
See TracChangeset
for help on using the changeset viewer.