Changeset cf2af94 in mainline for uspace/srv/fs/pipefs/pipefs_ops.c
- Timestamp:
- 2011-02-09T11:46:47Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cb15135a
- Parents:
- a49c4002 (diff), 0b37882 (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/pipefs/pipefs_ops.c
ra49c4002 rcf2af94 39 39 #include "pipefs.h" 40 40 #include "../../vfs/vfs.h" 41 #include <ipc/ipc.h>42 41 #include <macros.h> 43 42 #include <stdint.h> … … 457 456 rc = async_data_write_accept((void **) &opts, true, 0, 0, 0, NULL); 458 457 if (rc != EOK) { 459 ipc_answer_0(rid, rc);458 async_answer_0(rid, rc); 460 459 return; 461 460 } … … 466 465 (void) pipefs_node_put(rootfn); 467 466 free(opts); 468 ipc_answer_0(rid, EEXIST);467 async_answer_0(rid, EEXIST); 469 468 return; 470 469 } … … 473 472 if (!pipefs_instance_init(devmap_handle)) { 474 473 free(opts); 475 ipc_answer_0(rid, ENOMEM);474 async_answer_0(rid, ENOMEM); 476 475 return; 477 476 } … … 480 479 assert(rc == EOK); 481 480 pipefs_node_t *rootp = PIPEFS_NODE(rootfn); 482 ipc_answer_3(rid, EOK, rootp->index, rootp->size, rootp->lnkcnt);481 async_answer_3(rid, EOK, rootp->index, rootp->size, rootp->lnkcnt); 483 482 free(opts); 484 483 } … … 494 493 495 494 pipefs_instance_done(devmap_handle); 496 ipc_answer_0(rid, EOK);495 async_answer_0(rid, EOK); 497 496 } 498 497 … … 524 523 hlp = hash_table_find(&nodes, key); 525 524 if (!hlp) { 526 ipc_answer_0(rid, ENOENT);525 async_answer_0(rid, ENOENT); 527 526 return; 528 527 } … … 536 535 size_t size; 537 536 if (!async_data_read_receive(&callid, &size)) { 538 ipc_answer_0(callid, EINVAL);539 ipc_answer_0(rid, EINVAL);537 async_answer_0(callid, EINVAL); 538 async_answer_0(rid, EINVAL); 540 539 return; 541 540 } … … 548 547 */ 549 548 if (pos < nodep->start) { 550 ipc_answer_0(callid, ENOTSUP);551 ipc_answer_0(rid, ENOTSUP);549 async_answer_0(callid, ENOTSUP); 550 async_answer_0(rid, ENOTSUP); 552 551 return; 553 552 } … … 606 605 * and remove this else clause 607 606 */ 608 ipc_answer_0(callid, ENOTSUP);609 ipc_answer_1(rid, ENOTSUP, 0);607 async_answer_0(callid, ENOTSUP); 608 async_answer_1(rid, ENOTSUP, 0); 610 609 return; 611 610 } … … 628 627 629 628 if (lnk == &nodep->cs_head) { 630 ipc_answer_0(callid, ENOENT);631 ipc_answer_1(rid, ENOENT, 0);629 async_answer_0(callid, ENOENT); 630 async_answer_1(rid, ENOENT, 0); 632 631 return; 633 632 } … … 643 642 * Answer the VFS_READ call. 644 643 */ 645 ipc_answer_1(rid, EOK, bytes);644 async_answer_1(rid, EOK, bytes); 646 645 } 647 646 … … 663 662 hlp = hash_table_find(&nodes, key); 664 663 if (!hlp) { 665 ipc_answer_0(rid, ENOENT);664 async_answer_0(rid, ENOENT); 666 665 return; 667 666 } … … 675 674 size_t size; 676 675 if (!async_data_write_receive(&callid, &size)) { 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 } … … 684 683 */ 685 684 if (pos != nodep->size) { 686 ipc_answer_0(callid, ENOTSUP);687 ipc_answer_2(rid, EOK, 0, nodep->size);685 async_answer_0(callid, ENOTSUP); 686 async_answer_2(rid, EOK, 0, nodep->size); 688 687 return; 689 688 } … … 696 695 void *newdata = malloc(size); 697 696 if (!newdata) { 698 ipc_answer_0(callid, ENOMEM);699 ipc_answer_2(rid, EOK, 0, nodep->size);697 async_answer_0(callid, ENOMEM); 698 async_answer_2(rid, EOK, 0, nodep->size); 700 699 return; 701 700 } … … 705 704 if (!newblock) { 706 705 free(newdata); 707 ipc_answer_0(callid, ENOMEM);708 ipc_answer_2(rid, EOK, 0, nodep->size);706 async_answer_0(callid, ENOMEM); 707 async_answer_2(rid, EOK, 0, nodep->size); 709 708 return; 710 709 } … … 715 714 free(newblock); 716 715 free(newdata); 717 ipc_answer_0(callid, rc);718 ipc_answer_2(rid, EOK, 0, nodep->size);716 async_answer_0(callid, rc); 717 async_answer_2(rid, EOK, 0, nodep->size); 719 718 return; 720 719 } … … 727 726 nodep->size += size; 728 727 729 ipc_answer_2(rid, EOK, size, nodep->size);728 async_answer_2(rid, EOK, size, nodep->size); 730 729 } 731 730 … … 735 734 * PIPEFS does not support resizing of files 736 735 */ 737 ipc_answer_0(rid, ENOTSUP);736 async_answer_0(rid, ENOTSUP); 738 737 } 739 738 740 739 void pipefs_close(ipc_callid_t rid, ipc_call_t *request) 741 740 { 742 ipc_answer_0(rid, EOK);741 async_answer_0(rid, EOK); 743 742 } 744 743 … … 756 755 hlp = hash_table_find(&nodes, key); 757 756 if (!hlp) { 758 ipc_answer_0(rid, ENOENT);757 async_answer_0(rid, ENOENT); 759 758 return; 760 759 } … … 762 761 nh_link); 763 762 rc = pipefs_destroy_node(FS_NODE(nodep)); 764 ipc_answer_0(rid, rc);763 async_answer_0(rid, rc); 765 764 } 766 765 … … 781 780 * thus the sync operation is a no-op. 782 781 */ 783 ipc_answer_0(rid, EOK);782 async_answer_0(rid, EOK); 784 783 } 785 784
Note:
See TracChangeset
for help on using the changeset viewer.