Changeset 86ffa27f in mainline for uspace/srv
- Timestamp:
- 2011-08-07T11:21:44Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cc574511
- Parents:
- 15f3c3f (diff), e8067c0 (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. - Location:
- uspace/srv
- Files:
-
- 5 deleted
- 35 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/ata_bd/ata_bd.c
r15f3c3f r86ffa27f 80 80 */ 81 81 static const size_t identify_data_size = 512; 82 83 /** Size of the communication area. */84 static size_t comm_size;85 82 86 83 /** I/O base address of the command registers. */ … … 281 278 sysarg_t method; 282 279 service_id_t dsid; 280 size_t comm_size; /**< Size of the communication area. */ 283 281 unsigned int flags; 284 282 int retval; -
uspace/srv/devman/devman.c
r15f3c3f r86ffa27f 270 270 } 271 271 272 ssize_t read_bytes = safe_read(fd, buf, len);272 ssize_t read_bytes = read_all(fd, buf, len); 273 273 if (read_bytes <= 0) { 274 log_msg(LVL_ERROR, "Unable to read file '%s'.", conf_path); 274 log_msg(LVL_ERROR, "Unable to read file '%s' (%zd).", conf_path, 275 read_bytes); 275 276 goto cleanup; 276 277 } … … 421 422 } 422 423 423 insert_fun_node(tree, fun, clone_string(""), NULL);424 insert_fun_node(tree, fun, str_dup(""), NULL); 424 425 match_id_t *id = create_match_id(); 425 id->id = clone_string("root");426 id->id = str_dup("root"); 426 427 id->score = 100; 427 428 add_match_id(&fun->match_ids, id); -
uspace/srv/devman/util.c
r15f3c3f r86ffa27f 91 91 } 92 92 93 char *clone_string(const char *s)94 {95 size_t size = str_size(s) + 1;96 char *str;97 98 str = (char *) malloc(size);99 if (str != NULL)100 str_cpy(str, size, s);101 return str;102 }103 104 93 void replace_char(char *str, char orig, char repl) 105 94 { … … 111 100 } 112 101 113 ssize_t safe_read(int fd, void *buffer, size_t size)114 {115 if (size == 0) {116 return 0;117 }118 119 uint8_t *buf_ptr = (uint8_t *) buffer;120 121 size_t total_read = 0;122 while (total_read < size) {123 ssize_t bytes_read = read(fd, buf_ptr, size - total_read);124 if (bytes_read < 0) {125 /* Error. */126 return bytes_read;127 } else if (bytes_read == 0) {128 /* Possibly end of file. */129 break;130 } else {131 /* Read at least something. */132 buf_ptr += bytes_read;133 total_read += bytes_read;134 }135 }136 137 return (ssize_t) total_read;138 }139 140 102 /** @} 141 103 */ -
uspace/srv/devman/util.h
r15f3c3f r86ffa27f 44 44 extern size_t get_nonspace_len(const char *); 45 45 extern void free_not_null(const void *); 46 extern char *clone_string(const char *);47 46 extern void replace_char(char *, char, char); 48 49 extern ssize_t safe_read(int, void *, size_t);50 47 51 48 #endif -
uspace/srv/fs/ext2fs/ext2fs.c
r15f3c3f r86ffa27f 1 1 /* 2 2 * Copyright (c) 2006 Martin Decky 3 * Copyright (c) 2008 Jakub Jermar4 3 * Copyright (c) 2011 Martin Sucha 5 4 * All rights reserved. … … 55 54 }; 56 55 57 fs_reg_t ext2fs_reg;58 59 /**60 * This connection fibril processes VFS requests from VFS.61 *62 * In order to support simultaneous VFS requests, our design is as follows.63 * The connection fibril accepts VFS requests from VFS. If there is only one64 * instance of the fibril, VFS will need to serialize all VFS requests it sends65 * to EXT2FS. To overcome this bottleneck, VFS can send EXT2FS the IPC_M_CONNECT_ME_TO66 * call. In that case, a new connection fibril will be created, which in turn67 * will accept the call. Thus, a new phone will be opened for VFS.68 *69 * There are few issues with this arrangement. First, VFS can run out of70 * available phones. In that case, VFS can close some other phones or use one71 * phone for more serialized requests. Similarily, EXT2FS can refuse to duplicate72 * the connection. VFS should then just make use of already existing phones and73 * route its requests through them. To avoid paying the fibril creation price74 * upon each request, EXT2FS might want to keep the connections open after the75 * request has been completed.76 */77 static void ext2fs_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg)78 {79 if (iid) {80 /*81 * This only happens for connections opened by82 * IPC_M_CONNECT_ME_TO calls as opposed to callback connections83 * created by IPC_M_CONNECT_TO_ME.84 */85 async_answer_0(iid, EOK);86 }87 88 dprintf(NAME ": connection opened\n");89 while (true) {90 ipc_call_t call;91 ipc_callid_t callid = async_get_call(&call);92 93 if (!IPC_GET_IMETHOD(call))94 return;95 96 switch (IPC_GET_IMETHOD(call)) {97 case VFS_OUT_MOUNTED:98 ext2fs_mounted(callid, &call);99 break;100 case VFS_OUT_MOUNT:101 ext2fs_mount(callid, &call);102 break;103 case VFS_OUT_UNMOUNTED:104 ext2fs_unmounted(callid, &call);105 break;106 case VFS_OUT_UNMOUNT:107 ext2fs_unmount(callid, &call);108 break;109 case VFS_OUT_LOOKUP:110 ext2fs_lookup(callid, &call);111 break;112 case VFS_OUT_READ:113 ext2fs_read(callid, &call);114 break;115 case VFS_OUT_WRITE:116 ext2fs_write(callid, &call);117 break;118 case VFS_OUT_TRUNCATE:119 ext2fs_truncate(callid, &call);120 break;121 case VFS_OUT_STAT:122 ext2fs_stat(callid, &call);123 break;124 case VFS_OUT_CLOSE:125 ext2fs_close(callid, &call);126 break;127 case VFS_OUT_DESTROY:128 ext2fs_destroy(callid, &call);129 break;130 case VFS_OUT_OPEN_NODE:131 ext2fs_open_node(callid, &call);132 break;133 case VFS_OUT_SYNC:134 ext2fs_sync(callid, &call);135 break;136 default:137 async_answer_0(callid, ENOTSUP);138 break;139 }140 }141 }142 143 56 int main(int argc, char **argv) 144 57 { … … 158 71 } 159 72 160 rc = fs_register(vfs_sess, &ext2fs_reg, &ext2fs_vfs_info, ext2fs_connection); 73 rc = fs_register(vfs_sess, &ext2fs_vfs_info, &ext2fs_ops, 74 &ext2fs_libfs_ops); 161 75 if (rc != EOK) { 162 76 fprintf(stdout, NAME ": Failed to register fs (%d)\n", rc); -
uspace/srv/fs/ext2fs/ext2fs.h
r15f3c3f r86ffa27f 1 1 /* 2 * Copyright (c) 2008 Jakub Jermar3 2 * Copyright (c) 2011 Martin Sucha 4 3 * All rights reserved. … … 36 35 37 36 #include <libext2.h> 38 #include <fibril_synch.h>39 37 #include <libfs.h> 40 #include <atomic.h>41 38 #include <sys/types.h> 42 #include <bool.h>43 #include "../../vfs/vfs.h"44 45 #ifndef dprintf46 #define dprintf(...) printf(__VA_ARGS__)47 #endif48 39 49 40 #define min(a, b) ((a) < (b) ? (a) : (b)) 50 41 51 extern fs_reg_t ext2fs_reg; 42 extern vfs_out_ops_t ext2fs_ops; 43 extern libfs_ops_t ext2fs_libfs_ops; 52 44 53 45 extern int ext2fs_global_init(void); 54 46 extern int ext2fs_global_fini(void); 55 extern void ext2fs_mounted(ipc_callid_t, ipc_call_t *);56 extern void ext2fs_mount(ipc_callid_t, ipc_call_t *);57 extern void ext2fs_unmounted(ipc_callid_t, ipc_call_t *);58 extern void ext2fs_unmount(ipc_callid_t, ipc_call_t *);59 extern void ext2fs_lookup(ipc_callid_t, ipc_call_t *);60 extern void ext2fs_read(ipc_callid_t, ipc_call_t *);61 extern void ext2fs_write(ipc_callid_t, ipc_call_t *);62 extern void ext2fs_truncate(ipc_callid_t, ipc_call_t *);63 extern void ext2fs_stat(ipc_callid_t, ipc_call_t *);64 extern void ext2fs_close(ipc_callid_t, ipc_call_t *);65 extern void ext2fs_destroy(ipc_callid_t, ipc_call_t *);66 extern void ext2fs_open_node(ipc_callid_t, ipc_call_t *);67 extern void ext2fs_stat(ipc_callid_t, ipc_call_t *);68 extern void ext2fs_sync(ipc_callid_t, ipc_call_t *);69 47 70 48 #endif -
uspace/srv/fs/ext2fs/ext2fs_ops.c
r15f3c3f r86ffa27f 1 1 /* 2 * Copyright (c) 2008 Jakub Jermar3 2 * Copyright (c) 2011 Martin Sucha 4 3 * All rights reserved. … … 87 86 */ 88 87 static int ext2fs_instance_get(service_id_t, ext2fs_instance_t **); 89 static void ext2fs_read_directory(ipc_callid_t, ipc_callid_t, aoff64_t,90 size_t, ext2fs_instance_t *, ext2_inode_ref_t *);91 static void ext2fs_read_file(ipc_callid_t, ipc_callid_t, aoff64_t,92 size_t, ext2fs_instance_t *, ext2_inode_ref_t *);88 static int ext2fs_read_directory(ipc_callid_t, aoff64_t, size_t, 89 ext2fs_instance_t *, ext2_inode_ref_t *, size_t *); 90 static int ext2fs_read_file(ipc_callid_t, aoff64_t, size_t, ext2fs_instance_t *, 91 ext2_inode_ref_t *, size_t *); 93 92 static bool ext2fs_is_dots(const uint8_t *, size_t); 94 93 static int ext2fs_node_get_core(fs_node_t **, ext2fs_instance_t *, fs_index_t); … … 111 110 static aoff64_t ext2fs_size_get(fs_node_t *); 112 111 static unsigned ext2fs_lnkcnt_get(fs_node_t *); 113 static char ext2fs_plb_get_char(unsigned);114 112 static bool ext2fs_is_directory(fs_node_t *); 115 113 static bool ext2fs_is_file(fs_node_t *node); … … 240 238 } 241 239 242 rc = ext2_directory_iterator_init(&it, fs, eparent->inode_ref );240 rc = ext2_directory_iterator_init(&it, fs, eparent->inode_ref, 0); 243 241 if (rc != EOK) { 244 242 return rc; … … 478 476 } 479 477 480 rc = ext2_directory_iterator_init(&it, fs, enode->inode_ref );478 rc = ext2_directory_iterator_init(&it, fs, enode->inode_ref, 0); 481 479 if (rc != EOK) { 482 480 EXT2FS_DBG("error %u", rc); … … 538 536 EXT2FS_DBG("%u", count); 539 537 return count; 540 }541 542 char ext2fs_plb_get_char(unsigned pos)543 {544 return ext2fs_reg.plb_ro[pos % PLB_SIZE];545 538 } 546 539 … … 586 579 .size_get = ext2fs_size_get, 587 580 .lnkcnt_get = ext2fs_lnkcnt_get, 588 .plb_get_char = ext2fs_plb_get_char,589 581 .is_directory = ext2fs_is_directory, 590 582 .is_file = ext2fs_is_file, … … 596 588 */ 597 589 598 void ext2fs_mounted(ipc_callid_t rid, ipc_call_t *request) 599 { 600 EXT2FS_DBG(""); 601 int rc;602 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request);590 static int ext2fs_mounted(service_id_t service_id, const char *opts, 591 fs_index_t *index, aoff64_t *size, unsigned *lnkcnt) 592 { 593 EXT2FS_DBG(""); 594 int rc; 603 595 ext2_filesystem_t *fs; 604 596 ext2fs_instance_t *inst; 605 597 bool read_only; 606 598 607 /* Accept the mount options */608 char *opts;609 rc = async_data_write_accept((void **) &opts, true, 0, 0, 0, NULL);610 611 if (rc != EOK) {612 async_answer_0(rid, rc);613 return;614 }615 616 free(opts);617 618 599 /* Allocate libext2 filesystem structure */ 619 600 fs = (ext2_filesystem_t *) malloc(sizeof(ext2_filesystem_t)); 620 if (fs == NULL) { 621 async_answer_0(rid, ENOMEM); 622 return; 623 } 601 if (fs == NULL) 602 return ENOMEM; 624 603 625 604 /* Allocate instance structure */ … … 627 606 if (inst == NULL) { 628 607 free(fs); 629 async_answer_0(rid, ENOMEM); 630 return; 608 return ENOMEM; 631 609 } 632 610 … … 636 614 free(fs); 637 615 free(inst); 638 async_answer_0(rid, rc); 639 return; 616 return rc; 640 617 } 641 618 … … 646 623 free(fs); 647 624 free(inst); 648 async_answer_0(rid, rc); 649 return; 625 return rc; 650 626 } 651 627 … … 656 632 free(fs); 657 633 free(inst); 658 async_answer_0(rid, rc); 659 return; 634 return rc; 660 635 } 661 636 … … 673 648 free(fs); 674 649 free(inst); 675 async_answer_0(rid, rc); 676 return; 650 return rc; 677 651 } 678 652 ext2fs_node_t *enode = EXT2FS_NODE(root_node); … … 683 657 fibril_mutex_unlock(&instance_list_mutex); 684 658 685 async_answer_3(rid, EOK, 686 EXT2_INODE_ROOT_INDEX, 687 0, 688 ext2_inode_get_usage_count(enode->inode_ref->inode)); 659 *index = EXT2_INODE_ROOT_INDEX; 660 *size = 0; 661 *lnkcnt = ext2_inode_get_usage_count(enode->inode_ref->inode); 689 662 690 663 ext2fs_node_put(root_node); 691 } 692 693 void ext2fs_mount(ipc_callid_t rid, ipc_call_t *request) 694 { 695 EXT2FS_DBG(""); 696 libfs_mount(&ext2fs_libfs_ops, ext2fs_reg.fs_handle, rid, request); 697 } 698 699 void ext2fs_unmounted(ipc_callid_t rid, ipc_call_t *request) 700 { 701 EXT2FS_DBG(""); 702 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request); 664 665 return EOK; 666 } 667 668 static int ext2fs_unmounted(service_id_t service_id) 669 { 670 EXT2FS_DBG(""); 703 671 ext2fs_instance_t *inst; 704 672 int rc; … … 706 674 rc = ext2fs_instance_get(service_id, &inst); 707 675 708 if (rc != EOK) { 709 async_answer_0(rid, rc); 710 return; 711 } 676 if (rc != EOK) 677 return rc; 712 678 713 679 fibril_mutex_lock(&open_nodes_lock); … … 716 682 if (inst->open_nodes_count != 0) { 717 683 fibril_mutex_unlock(&open_nodes_lock); 718 async_answer_0(rid, EBUSY); 719 return; 684 return EBUSY; 720 685 } 721 686 … … 729 694 ext2_filesystem_fini(inst->filesystem); 730 695 731 async_answer_0(rid, EOK); 732 } 733 734 void ext2fs_unmount(ipc_callid_t rid, ipc_call_t *request) 735 { 736 EXT2FS_DBG(""); 737 libfs_unmount(&ext2fs_libfs_ops, rid, request); 738 } 739 740 void ext2fs_lookup(ipc_callid_t rid, ipc_call_t *request) 741 { 742 EXT2FS_DBG(""); 743 libfs_lookup(&ext2fs_libfs_ops, ext2fs_reg.fs_handle, rid, request); 744 } 745 746 void ext2fs_read(ipc_callid_t rid, ipc_call_t *request) 747 { 748 EXT2FS_DBG(""); 749 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request); 750 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); 751 aoff64_t pos = 752 (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*request), IPC_GET_ARG4(*request)); 696 return EOK; 697 } 698 699 static int 700 ext2fs_read(service_id_t service_id, fs_index_t index, aoff64_t pos, 701 size_t *rbytes) 702 { 703 EXT2FS_DBG(""); 753 704 754 705 ext2fs_instance_t *inst; … … 763 714 if (!async_data_read_receive(&callid, &size)) { 764 715 async_answer_0(callid, EINVAL); 765 async_answer_0(rid, EINVAL); 766 return; 716 return EINVAL; 767 717 } 768 718 … … 770 720 if (rc != EOK) { 771 721 async_answer_0(callid, rc); 772 async_answer_0(rid, rc); 773 return; 722 return rc; 774 723 } 775 724 … … 777 726 if (rc != EOK) { 778 727 async_answer_0(callid, rc); 779 async_answer_0(rid, rc); 780 return; 728 return rc; 781 729 } 782 730 783 731 if (ext2_inode_is_type(inst->filesystem->superblock, inode_ref->inode, 784 785 ext2fs_read_file(rid, callid, pos, size, inst, inode_ref);786 }787 else if (ext2_inode_is_type(inst->filesystem->superblock, inode_ref->inode,788 789 ext2fs_read_directory(rid, callid, pos, size, inst, inode_ref);790 }791 else {732 EXT2_INODE_MODE_FILE)) { 733 rc = ext2fs_read_file(callid, pos, size, inst, inode_ref, 734 rbytes); 735 } else if (ext2_inode_is_type(inst->filesystem->superblock, 736 inode_ref->inode, EXT2_INODE_MODE_DIRECTORY)) { 737 rc = ext2fs_read_directory(callid, pos, size, inst, inode_ref, 738 rbytes); 739 } else { 792 740 /* Other inode types not supported */ 793 741 async_answer_0(callid, ENOTSUP); 794 async_answer_0(rid, ENOTSUP);742 rc = ENOTSUP; 795 743 } 796 744 797 745 ext2_filesystem_put_inode_ref(inode_ref); 798 746 747 return rc; 799 748 } 800 749 … … 814 763 } 815 764 816 void ext2fs_read_directory(ipc_callid_t rid, ipc_callid_t callid, aoff64_t pos,817 size_t size, ext2fs_instance_t *inst, ext2_inode_ref_t *inode_ref)765 int ext2fs_read_directory(ipc_callid_t callid, aoff64_t pos, size_t size, 766 ext2fs_instance_t *inst, ext2_inode_ref_t *inode_ref, size_t *rbytes) 818 767 { 819 768 ext2_directory_iterator_t it; 820 aoff64_t cur;769 aoff64_t next; 821 770 uint8_t *buf; 822 771 size_t name_size; … … 824 773 bool found = false; 825 774 826 rc = ext2_directory_iterator_init(&it, inst->filesystem, inode_ref );775 rc = ext2_directory_iterator_init(&it, inst->filesystem, inode_ref, pos); 827 776 if (rc != EOK) { 828 777 async_answer_0(callid, rc); 829 async_answer_0(rid, rc); 830 return; 831 } 832 833 /* Find the index we want to read 834 * Note that we need to iterate and count as 835 * the underlying structure is a linked list 836 * Moreover, we want to skip . and .. entries 778 return rc; 779 } 780 781 /* Find next interesting directory entry. 782 * We want to skip . and .. entries 837 783 * as these are not used in HelenOS 838 784 */ 839 cur = 0;840 785 while (it.current != NULL) { 841 786 if (it.current->inode == 0) { … … 844 789 845 790 name_size = ext2_directory_entry_ll_get_name_length( 846 791 inst->filesystem->superblock, it.current); 847 792 848 793 /* skip . and .. */ … … 851 796 } 852 797 853 /* Is this the dir entry we want to read? */ 854 if (cur == pos) { 855 /* The on-disk entry does not contain \0 at the end 856 * end of entry name, so we copy it to new buffer 857 * and add the \0 at the end 858 */ 859 buf = malloc(name_size+1); 860 if (buf == NULL) { 861 ext2_directory_iterator_fini(&it); 862 async_answer_0(callid, ENOMEM); 863 async_answer_0(rid, ENOMEM); 864 return; 865 } 866 memcpy(buf, &it.current->name, name_size); 867 *(buf+name_size) = 0; 868 found = true; 869 (void) async_data_read_finalize(callid, buf, name_size+1); 870 free(buf); 871 break; 872 } 873 cur++; 798 /* The on-disk entry does not contain \0 at the end 799 * end of entry name, so we copy it to new buffer 800 * and add the \0 at the end 801 */ 802 buf = malloc(name_size+1); 803 if (buf == NULL) { 804 ext2_directory_iterator_fini(&it); 805 async_answer_0(callid, ENOMEM); 806 return ENOMEM; 807 } 808 memcpy(buf, &it.current->name, name_size); 809 *(buf + name_size) = 0; 810 found = true; 811 (void) async_data_read_finalize(callid, buf, name_size + 1); 812 free(buf); 813 break; 874 814 875 815 skip: … … 878 818 ext2_directory_iterator_fini(&it); 879 819 async_answer_0(callid, rc); 880 async_answer_0(rid, rc); 881 return; 882 } 820 return rc; 821 } 822 } 823 824 if (found) { 825 rc = ext2_directory_iterator_next(&it); 826 if (rc != EOK) 827 return rc; 828 next = it.current_offset; 883 829 } 884 830 885 831 rc = ext2_directory_iterator_fini(&it); 886 if (rc != EOK) { 887 async_answer_0(rid, rc); 888 return; 889 } 832 if (rc != EOK) 833 return rc; 890 834 891 835 if (found) { 892 async_answer_1(rid, EOK, 1);893 }894 else {836 *rbytes = next - pos; 837 return EOK; 838 } else { 895 839 async_answer_0(callid, ENOENT); 896 async_answer_0(rid, ENOENT);897 } 898 } 899 900 void ext2fs_read_file(ipc_callid_t rid, ipc_callid_t callid, aoff64_t pos,901 size_t size, ext2fs_instance_t *inst, ext2_inode_ref_t *inode_ref)840 return ENOENT; 841 } 842 } 843 844 int ext2fs_read_file(ipc_callid_t callid, aoff64_t pos, size_t size, 845 ext2fs_instance_t *inst, ext2_inode_ref_t *inode_ref, size_t *rbytes) 902 846 { 903 847 int rc; … … 917 861 /* Read 0 bytes successfully */ 918 862 async_data_read_finalize(callid, NULL, 0); 919 async_answer_1(rid, EOK, 0);920 return ;863 *rbytes = 0; 864 return EOK; 921 865 } 922 866 … … 937 881 if (rc != EOK) { 938 882 async_answer_0(callid, rc); 939 async_answer_0(rid, rc); 940 return; 883 return rc; 941 884 } 942 885 … … 950 893 if (buffer == NULL) { 951 894 async_answer_0(callid, ENOMEM); 952 async_answer_0(rid, ENOMEM); 953 return; 895 return ENOMEM; 954 896 } 955 897 … … 957 899 958 900 async_data_read_finalize(callid, buffer, bytes); 959 async_answer_1(rid, EOK, bytes);901 *rbytes = bytes; 960 902 961 903 free(buffer); 962 904 963 return ;905 return EOK; 964 906 } 965 907 … … 968 910 if (rc != EOK) { 969 911 async_answer_0(callid, rc); 970 async_answer_0(rid, rc); 971 return; 912 return rc; 972 913 } 973 914 … … 976 917 977 918 rc = block_put(block); 978 if (rc != EOK) { 979 async_answer_0(rid, rc); 980 return; 981 } 982 983 async_answer_1(rid, EOK, bytes); 984 } 985 986 void ext2fs_write(ipc_callid_t rid, ipc_call_t *request) 987 { 988 EXT2FS_DBG(""); 989 // service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request); 990 // fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); 991 // aoff64_t pos = 992 // (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*request), IPC_GET_ARG4(*request)); 993 994 // TODO 995 async_answer_0(rid, ENOTSUP); 996 } 997 998 void ext2fs_truncate(ipc_callid_t rid, ipc_call_t *request) 999 { 1000 EXT2FS_DBG(""); 1001 // service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request); 1002 // fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); 1003 // aoff64_t size = 1004 // (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*request), IPC_GET_ARG4(*request)); 1005 1006 // TODO 1007 async_answer_0(rid, ENOTSUP); 1008 } 1009 1010 void ext2fs_close(ipc_callid_t rid, ipc_call_t *request) 1011 { 1012 EXT2FS_DBG(""); 1013 async_answer_0(rid, EOK); 1014 } 1015 1016 void ext2fs_destroy(ipc_callid_t rid, ipc_call_t *request) 1017 { 1018 EXT2FS_DBG(""); 1019 // service_id_t service_id = (service_id_t)IPC_GET_ARG1(*request); 1020 // fs_index_t index = (fs_index_t)IPC_GET_ARG2(*request); 1021 1022 // TODO 1023 async_answer_0(rid, ENOTSUP); 1024 } 1025 1026 void ext2fs_open_node(ipc_callid_t rid, ipc_call_t *request) 1027 { 1028 EXT2FS_DBG(""); 1029 libfs_open_node(&ext2fs_libfs_ops, ext2fs_reg.fs_handle, rid, request); 1030 } 1031 1032 void ext2fs_stat(ipc_callid_t rid, ipc_call_t *request) 1033 { 1034 EXT2FS_DBG(""); 1035 libfs_stat(&ext2fs_libfs_ops, ext2fs_reg.fs_handle, rid, request); 1036 } 1037 1038 void ext2fs_sync(ipc_callid_t rid, ipc_call_t *request) 1039 { 1040 EXT2FS_DBG(""); 1041 // service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request); 1042 // fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); 1043 1044 // TODO 1045 async_answer_0(rid, ENOTSUP); 1046 } 919 if (rc != EOK) 920 return rc; 921 922 *rbytes = bytes; 923 return EOK; 924 } 925 926 static int 927 ext2fs_write(service_id_t service_id, fs_index_t index, aoff64_t pos, 928 size_t *wbytes, aoff64_t *nsize) 929 { 930 EXT2FS_DBG(""); 931 return ENOTSUP; 932 } 933 934 static int 935 ext2fs_truncate(service_id_t service_id, fs_index_t index, aoff64_t size) 936 { 937 EXT2FS_DBG(""); 938 return ENOTSUP; 939 } 940 941 static int ext2fs_close(service_id_t service_id, fs_index_t index) 942 { 943 EXT2FS_DBG(""); 944 return EOK; 945 } 946 947 static int ext2fs_destroy(service_id_t service_id, fs_index_t index) 948 { 949 EXT2FS_DBG(""); 950 return ENOTSUP; 951 } 952 953 static int ext2fs_sync(service_id_t service_id, fs_index_t index) 954 { 955 EXT2FS_DBG(""); 956 return ENOTSUP; 957 } 958 959 vfs_out_ops_t ext2fs_ops = { 960 .mounted = ext2fs_mounted, 961 .unmounted = ext2fs_unmounted, 962 .read = ext2fs_read, 963 .write = ext2fs_write, 964 .truncate = ext2fs_truncate, 965 .close = ext2fs_close, 966 .destroy = ext2fs_destroy, 967 .sync = ext2fs_sync, 968 }; 1047 969 1048 970 /** 1049 971 * @} 1050 972 */ 973 -
uspace/srv/fs/fat/fat.c
r15f3c3f r86ffa27f 56 56 }; 57 57 58 fs_reg_t fat_reg;59 60 /**61 * This connection fibril processes VFS requests from VFS.62 *63 * In order to support simultaneous VFS requests, our design is as follows.64 * The connection fibril accepts VFS requests from VFS. If there is only one65 * instance of the fibril, VFS will need to serialize all VFS requests it sends66 * to FAT. To overcome this bottleneck, VFS can send FAT the IPC_M_CONNECT_ME_TO67 * call. In that case, a new connection fibril will be created, which in turn68 * will accept the call. Thus, a new phone will be opened for VFS.69 *70 * There are few issues with this arrangement. First, VFS can run out of71 * available phones. In that case, VFS can close some other phones or use one72 * phone for more serialized requests. Similarily, FAT can refuse to duplicate73 * the connection. VFS should then just make use of already existing phones and74 * route its requests through them. To avoid paying the fibril creation price75 * upon each request, FAT might want to keep the connections open after the76 * request has been completed.77 */78 static void fat_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg)79 {80 if (iid) {81 /*82 * This only happens for connections opened by83 * IPC_M_CONNECT_ME_TO calls as opposed to callback connections84 * created by IPC_M_CONNECT_TO_ME.85 */86 async_answer_0(iid, EOK);87 }88 89 dprintf(NAME ": connection opened\n");90 91 while (true) {92 ipc_call_t call;93 ipc_callid_t callid = async_get_call(&call);94 95 if (!IPC_GET_IMETHOD(call))96 return;97 98 switch (IPC_GET_IMETHOD(call)) {99 case VFS_OUT_MOUNTED:100 fat_mounted(callid, &call);101 break;102 case VFS_OUT_MOUNT:103 fat_mount(callid, &call);104 break;105 case VFS_OUT_UNMOUNTED:106 fat_unmounted(callid, &call);107 break;108 case VFS_OUT_UNMOUNT:109 fat_unmount(callid, &call);110 break;111 case VFS_OUT_LOOKUP:112 fat_lookup(callid, &call);113 break;114 case VFS_OUT_READ:115 fat_read(callid, &call);116 break;117 case VFS_OUT_WRITE:118 fat_write(callid, &call);119 break;120 case VFS_OUT_TRUNCATE:121 fat_truncate(callid, &call);122 break;123 case VFS_OUT_STAT:124 fat_stat(callid, &call);125 break;126 case VFS_OUT_CLOSE:127 fat_close(callid, &call);128 break;129 case VFS_OUT_DESTROY:130 fat_destroy(callid, &call);131 break;132 case VFS_OUT_OPEN_NODE:133 fat_open_node(callid, &call);134 break;135 case VFS_OUT_SYNC:136 fat_sync(callid, &call);137 break;138 default:139 async_answer_0(callid, ENOTSUP);140 break;141 }142 }143 }144 145 58 int main(int argc, char **argv) 146 59 { … … 158 71 } 159 72 160 rc = fs_register(vfs_sess, &fat_ reg, &fat_vfs_info, fat_connection);73 rc = fs_register(vfs_sess, &fat_vfs_info, &fat_ops, &fat_libfs_ops); 161 74 if (rc != EOK) { 162 75 fat_idx_fini(); -
uspace/srv/fs/fat/fat.h
r15f3c3f r86ffa27f 224 224 } fat_node_t; 225 225 226 extern fs_reg_t fat_reg; 227 228 extern void fat_mounted(ipc_callid_t, ipc_call_t *); 229 extern void fat_mount(ipc_callid_t, ipc_call_t *); 230 extern void fat_unmounted(ipc_callid_t, ipc_call_t *); 231 extern void fat_unmount(ipc_callid_t, ipc_call_t *); 232 extern void fat_lookup(ipc_callid_t, ipc_call_t *); 233 extern void fat_read(ipc_callid_t, ipc_call_t *); 234 extern void fat_write(ipc_callid_t, ipc_call_t *); 235 extern void fat_truncate(ipc_callid_t, ipc_call_t *); 236 extern void fat_stat(ipc_callid_t, ipc_call_t *); 237 extern void fat_close(ipc_callid_t, ipc_call_t *); 238 extern void fat_destroy(ipc_callid_t, ipc_call_t *); 239 extern void fat_open_node(ipc_callid_t, ipc_call_t *); 240 extern void fat_stat(ipc_callid_t, ipc_call_t *); 241 extern void fat_sync(ipc_callid_t, ipc_call_t *); 226 extern vfs_out_ops_t fat_ops; 227 extern libfs_ops_t fat_libfs_ops; 242 228 243 229 extern int fat_idx_get_new(fat_idx_t **, service_id_t); -
uspace/srv/fs/fat/fat_ops.c
r15f3c3f r86ffa27f 85 85 static aoff64_t fat_size_get(fs_node_t *); 86 86 static unsigned fat_lnkcnt_get(fs_node_t *); 87 static char fat_plb_get_char(unsigned);88 87 static bool fat_is_directory(fs_node_t *); 89 88 static bool fat_is_file(fs_node_t *node); … … 901 900 } 902 901 903 char fat_plb_get_char(unsigned pos)904 {905 return fat_reg.plb_ro[pos % PLB_SIZE];906 }907 908 902 bool fat_is_directory(fs_node_t *fn) 909 903 { … … 936 930 .size_get = fat_size_get, 937 931 .lnkcnt_get = fat_lnkcnt_get, 938 .plb_get_char = fat_plb_get_char,939 932 .is_directory = fat_is_directory, 940 933 .is_file = fat_is_file, … … 943 936 944 937 /* 945 * VFSoperations.938 * FAT VFS_OUT operations. 946 939 */ 947 940 948 void fat_mounted(ipc_callid_t rid, ipc_call_t *request) 949 { 950 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request); 941 static int 942 fat_mounted(service_id_t service_id, const char *opts, fs_index_t *index, 943 aoff64_t *size, unsigned *linkcnt) 944 { 951 945 enum cache_mode cmode; 952 946 fat_bs_t *bs; 953 954 /* Accept the mount options */ 955 char *opts; 956 int rc = async_data_write_accept((void **) &opts, true, 0, 0, 0, NULL); 957 958 if (rc != EOK) { 959 async_answer_0(rid, rc); 960 return; 961 } 962 947 int rc; 948 963 949 /* Check for option enabling write through. */ 964 950 if (str_cmp(opts, "wtcache") == 0) … … 967 953 cmode = CACHE_MODE_WB; 968 954 969 free(opts);970 971 955 /* initialize libblock */ 972 956 rc = block_init(EXCHANGE_SERIALIZE, service_id, BS_SIZE); 973 if (rc != EOK) { 974 async_answer_0(rid, rc); 975 return; 976 } 957 if (rc != EOK) 958 return rc; 977 959 978 960 /* prepare the boot block */ … … 980 962 if (rc != EOK) { 981 963 block_fini(service_id); 982 async_answer_0(rid, rc); 983 return; 964 return rc; 984 965 } 985 966 … … 989 970 if (BPS(bs) != BS_SIZE) { 990 971 block_fini(service_id); 991 async_answer_0(rid, ENOTSUP); 992 return; 972 return ENOTSUP; 993 973 } 994 974 … … 997 977 if (rc != EOK) { 998 978 block_fini(service_id); 999 async_answer_0(rid, rc); 1000 return; 979 return rc; 1001 980 } 1002 981 … … 1006 985 (void) block_cache_fini(service_id); 1007 986 block_fini(service_id); 1008 async_answer_0(rid, rc); 1009 return; 987 return rc; 1010 988 } 1011 989 … … 1014 992 (void) block_cache_fini(service_id); 1015 993 block_fini(service_id); 1016 async_answer_0(rid, rc); 1017 return; 994 return rc; 1018 995 } 1019 996 … … 1024 1001 block_fini(service_id); 1025 1002 fat_idx_fini_by_service_id(service_id); 1026 async_answer_0(rid, ENOMEM); 1027 return; 1003 return ENOMEM; 1028 1004 } 1029 1005 fs_node_initialize(rfn); … … 1034 1010 block_fini(service_id); 1035 1011 fat_idx_fini_by_service_id(service_id); 1036 async_answer_0(rid, ENOMEM); 1037 return; 1012 return ENOMEM; 1038 1013 } 1039 1014 fat_node_initialize(rootp); … … 1046 1021 block_fini(service_id); 1047 1022 fat_idx_fini_by_service_id(service_id); 1048 async_answer_0(rid, ENOMEM); 1049 return; 1023 return ENOMEM; 1050 1024 } 1051 1025 assert(ridxp->index == 0); … … 1064 1038 fibril_mutex_unlock(&ridxp->lock); 1065 1039 1066 async_answer_3(rid, EOK, ridxp->index, rootp->size, rootp->lnkcnt); 1067 } 1068 1069 void fat_mount(ipc_callid_t rid, ipc_call_t *request) 1070 { 1071 libfs_mount(&fat_libfs_ops, fat_reg.fs_handle, rid, request); 1072 } 1073 1074 void fat_unmounted(ipc_callid_t rid, ipc_call_t *request) 1075 { 1076 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request); 1040 *index = ridxp->index; 1041 *size = rootp->size; 1042 *linkcnt = rootp->lnkcnt; 1043 1044 return EOK; 1045 } 1046 1047 static int fat_unmounted(service_id_t service_id) 1048 { 1077 1049 fs_node_t *fn; 1078 1050 fat_node_t *nodep; … … 1080 1052 1081 1053 rc = fat_root_get(&fn, service_id); 1082 if (rc != EOK) { 1083 async_answer_0(rid, rc); 1084 return; 1085 } 1054 if (rc != EOK) 1055 return rc; 1086 1056 nodep = FAT_NODE(fn); 1087 1057 … … 1092 1062 if (nodep->refcnt != 2) { 1093 1063 (void) fat_node_put(fn); 1094 async_answer_0(rid, EBUSY); 1095 return; 1064 return EBUSY; 1096 1065 } 1097 1066 … … 1112 1081 block_fini(service_id); 1113 1082 1114 async_answer_0(rid, EOK); 1115 } 1116 1117 void fat_unmount(ipc_callid_t rid, ipc_call_t *request) 1118 { 1119 libfs_unmount(&fat_libfs_ops, rid, request); 1120 } 1121 1122 void fat_lookup(ipc_callid_t rid, ipc_call_t *request) 1123 { 1124 libfs_lookup(&fat_libfs_ops, fat_reg.fs_handle, rid, request); 1125 } 1126 1127 void fat_read(ipc_callid_t rid, ipc_call_t *request) 1128 { 1129 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request); 1130 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); 1131 aoff64_t pos = 1132 (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*request), IPC_GET_ARG4(*request)); 1083 return EOK; 1084 } 1085 1086 static int 1087 fat_read(service_id_t service_id, fs_index_t index, aoff64_t pos, 1088 size_t *rbytes) 1089 { 1133 1090 fs_node_t *fn; 1134 1091 fat_node_t *nodep; … … 1139 1096 1140 1097 rc = fat_node_get(&fn, service_id, index); 1141 if (rc != EOK) { 1142 async_answer_0(rid, rc); 1143 return; 1144 } 1145 if (!fn) { 1146 async_answer_0(rid, ENOENT); 1147 return; 1148 } 1098 if (rc != EOK) 1099 return rc; 1100 if (!fn) 1101 return ENOENT; 1149 1102 nodep = FAT_NODE(fn); 1150 1103 … … 1154 1107 fat_node_put(fn); 1155 1108 async_answer_0(callid, EINVAL); 1156 async_answer_0(rid, EINVAL); 1157 return; 1109 return EINVAL; 1158 1110 } 1159 1111 … … 1178 1130 fat_node_put(fn); 1179 1131 async_answer_0(callid, rc); 1180 async_answer_0(rid, rc); 1181 return; 1132 return rc; 1182 1133 } 1183 1134 (void) async_data_read_finalize(callid, … … 1186 1137 if (rc != EOK) { 1187 1138 fat_node_put(fn); 1188 async_answer_0(rid, rc); 1189 return; 1139 return rc; 1190 1140 } 1191 1141 } … … 1244 1194 rc = fat_node_put(fn); 1245 1195 async_answer_0(callid, rc != EOK ? rc : ENOENT); 1246 async_answer_1(rid, rc != EOK ? rc : ENOENT, 0);1247 return ;1196 *rbytes = 0; 1197 return rc != EOK ? rc : ENOENT; 1248 1198 1249 1199 err: 1250 1200 (void) fat_node_put(fn); 1251 1201 async_answer_0(callid, rc); 1252 async_answer_0(rid, rc); 1253 return; 1202 return rc; 1254 1203 1255 1204 hit: … … 1259 1208 1260 1209 rc = fat_node_put(fn); 1261 async_answer_1(rid, rc, (sysarg_t)bytes); 1262 } 1263 1264 void fat_write(ipc_callid_t rid, ipc_call_t *request) 1265 { 1266 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request); 1267 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); 1268 aoff64_t pos = 1269 (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*request), IPC_GET_ARG4(*request)); 1210 *rbytes = bytes; 1211 return rc; 1212 } 1213 1214 static int 1215 fat_write(service_id_t service_id, fs_index_t index, aoff64_t pos, 1216 size_t *wbytes, aoff64_t *nsize) 1217 { 1270 1218 fs_node_t *fn; 1271 1219 fat_node_t *nodep; 1272 1220 fat_bs_t *bs; 1273 size_t bytes , size;1221 size_t bytes; 1274 1222 block_t *b; 1275 1223 aoff64_t boundary; … … 1278 1226 1279 1227 rc = fat_node_get(&fn, service_id, index); 1280 if (rc != EOK) { 1281 async_answer_0(rid, rc); 1282 return; 1283 } 1284 if (!fn) { 1285 async_answer_0(rid, ENOENT); 1286 return; 1287 } 1228 if (rc != EOK) 1229 return rc; 1230 if (!fn) 1231 return ENOENT; 1288 1232 nodep = FAT_NODE(fn); 1289 1233 … … 1293 1237 (void) fat_node_put(fn); 1294 1238 async_answer_0(callid, EINVAL); 1295 async_answer_0(rid, EINVAL); 1296 return; 1239 return EINVAL; 1297 1240 } 1298 1241 … … 1322 1265 (void) fat_node_put(fn); 1323 1266 async_answer_0(callid, rc); 1324 async_answer_0(rid, rc); 1325 return; 1267 return rc; 1326 1268 } 1327 1269 rc = fat_block_get(&b, bs, nodep, pos / BPS(bs), flags); … … 1329 1271 (void) fat_node_put(fn); 1330 1272 async_answer_0(callid, rc); 1331 async_answer_0(rid, rc); 1332 return; 1273 return rc; 1333 1274 } 1334 1275 (void) async_data_write_finalize(callid, … … 1338 1279 if (rc != EOK) { 1339 1280 (void) fat_node_put(fn); 1340 async_answer_0(rid, rc); 1341 return; 1281 return rc; 1342 1282 } 1343 1283 if (pos + bytes > nodep->size) { … … 1345 1285 nodep->dirty = true; /* need to sync node */ 1346 1286 } 1347 size = nodep->size; 1287 *wbytes = bytes; 1288 *nsize = nodep->size; 1348 1289 rc = fat_node_put(fn); 1349 async_answer_2(rid, rc, bytes, nodep->size); 1350 return; 1290 return rc; 1351 1291 } else { 1352 1292 /* … … 1364 1304 (void) fat_node_put(fn); 1365 1305 async_answer_0(callid, rc); 1366 async_answer_0(rid, rc); 1367 return; 1306 return rc; 1368 1307 } 1369 1308 /* zero fill any gaps */ … … 1373 1312 (void) fat_node_put(fn); 1374 1313 async_answer_0(callid, rc); 1375 async_answer_0(rid, rc); 1376 return; 1314 return rc; 1377 1315 } 1378 1316 rc = _fat_block_get(&b, bs, service_id, lcl, NULL, … … 1382 1320 (void) fat_node_put(fn); 1383 1321 async_answer_0(callid, rc); 1384 async_answer_0(rid, rc); 1385 return; 1322 return rc; 1386 1323 } 1387 1324 (void) async_data_write_finalize(callid, … … 1392 1329 (void) fat_free_clusters(bs, service_id, mcl); 1393 1330 (void) fat_node_put(fn); 1394 async_answer_0(rid, rc); 1395 return; 1331 return rc; 1396 1332 } 1397 1333 /* … … 1403 1339 (void) fat_free_clusters(bs, service_id, mcl); 1404 1340 (void) fat_node_put(fn); 1405 async_answer_0(rid, rc);1406 return;1407 }1408 nodep->size = size = pos + bytes;1341 return rc; 1342 } 1343 *nsize = nodep->size = pos + bytes; 1344 rc = fat_node_put(fn); 1409 1345 nodep->dirty = true; /* need to sync node */ 1410 rc = fat_node_put(fn); 1411 async_answer_2(rid, rc, bytes, size); 1412 return; 1413 } 1414 } 1415 1416 void fat_truncate(ipc_callid_t rid, ipc_call_t *request) 1417 { 1418 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request); 1419 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); 1420 aoff64_t size = 1421 (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*request), IPC_GET_ARG4(*request)); 1346 *wbytes = bytes; 1347 return rc; 1348 } 1349 } 1350 1351 static int 1352 fat_truncate(service_id_t service_id, fs_index_t index, aoff64_t size) 1353 { 1422 1354 fs_node_t *fn; 1423 1355 fat_node_t *nodep; … … 1426 1358 1427 1359 rc = fat_node_get(&fn, service_id, index); 1428 if (rc != EOK) { 1429 async_answer_0(rid, rc); 1430 return; 1431 } 1432 if (!fn) { 1433 async_answer_0(rid, ENOENT); 1434 return; 1435 } 1360 if (rc != EOK) 1361 return rc; 1362 if (!fn) 1363 return ENOENT; 1436 1364 nodep = FAT_NODE(fn); 1437 1365 … … 1477 1405 out: 1478 1406 fat_node_put(fn); 1479 async_answer_0(rid, rc); 1480 return; 1481 } 1482 1483 void fat_close(ipc_callid_t rid, ipc_call_t *request) 1484 { 1485 async_answer_0(rid, EOK); 1486 } 1487 1488 void fat_destroy(ipc_callid_t rid, ipc_call_t *request) 1489 { 1490 service_id_t service_id = (service_id_t)IPC_GET_ARG1(*request); 1491 fs_index_t index = (fs_index_t)IPC_GET_ARG2(*request); 1407 return rc; 1408 } 1409 1410 static int fat_close(service_id_t service_id, fs_index_t index) 1411 { 1412 return EOK; 1413 } 1414 1415 static int fat_destroy(service_id_t service_id, fs_index_t index) 1416 { 1492 1417 fs_node_t *fn; 1493 1418 fat_node_t *nodep; … … 1495 1420 1496 1421 rc = fat_node_get(&fn, service_id, index); 1497 if (rc != EOK) { 1498 async_answer_0(rid, rc); 1499 return; 1500 } 1501 if (!fn) { 1502 async_answer_0(rid, ENOENT); 1503 return; 1504 } 1422 if (rc != EOK) 1423 return rc; 1424 if (!fn) 1425 return ENOENT; 1505 1426 1506 1427 nodep = FAT_NODE(fn); … … 1512 1433 1513 1434 rc = fat_destroy_node(fn); 1514 async_answer_0(rid, rc); 1515 } 1516 1517 void fat_open_node(ipc_callid_t rid, ipc_call_t *request) 1518 { 1519 libfs_open_node(&fat_libfs_ops, fat_reg.fs_handle, rid, request); 1520 } 1521 1522 void fat_stat(ipc_callid_t rid, ipc_call_t *request) 1523 { 1524 libfs_stat(&fat_libfs_ops, fat_reg.fs_handle, rid, request); 1525 } 1526 1527 void fat_sync(ipc_callid_t rid, ipc_call_t *request) 1528 { 1529 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request); 1530 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); 1531 1435 return rc; 1436 } 1437 1438 static int fat_sync(service_id_t service_id, fs_index_t index) 1439 { 1532 1440 fs_node_t *fn; 1533 1441 int rc = fat_node_get(&fn, service_id, index); 1534 if (rc != EOK) { 1535 async_answer_0(rid, rc); 1536 return; 1537 } 1538 if (!fn) { 1539 async_answer_0(rid, ENOENT); 1540 return; 1541 } 1442 if (rc != EOK) 1443 return rc; 1444 if (!fn) 1445 return ENOENT; 1542 1446 1543 1447 fat_node_t *nodep = FAT_NODE(fn); … … 1547 1451 1548 1452 fat_node_put(fn); 1549 async_answer_0(rid, rc); 1550 } 1453 return rc; 1454 } 1455 1456 vfs_out_ops_t fat_ops = { 1457 .mounted = fat_mounted, 1458 .unmounted = fat_unmounted, 1459 .read = fat_read, 1460 .write = fat_write, 1461 .truncate = fat_truncate, 1462 .close = fat_close, 1463 .destroy = fat_destroy, 1464 .sync = fat_sync, 1465 }; 1551 1466 1552 1467 /** -
uspace/srv/fs/locfs/locfs.c
r15f3c3f r86ffa27f 57 57 }; 58 58 59 fs_reg_t locfs_reg;60 61 static void locfs_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg)62 {63 if (iid)64 async_answer_0(iid, EOK);65 66 while (true) {67 ipc_call_t call;68 ipc_callid_t callid = async_get_call(&call);69 70 if (!IPC_GET_IMETHOD(call))71 return;72 73 switch (IPC_GET_IMETHOD(call)) {74 case VFS_OUT_MOUNTED:75 locfs_mounted(callid, &call);76 break;77 case VFS_OUT_MOUNT:78 locfs_mount(callid, &call);79 break;80 case VFS_OUT_UNMOUNTED:81 locfs_unmounted(callid, &call);82 break;83 case VFS_OUT_UNMOUNT:84 locfs_unmount(callid, &call);85 break;86 case VFS_OUT_LOOKUP:87 locfs_lookup(callid, &call);88 break;89 case VFS_OUT_OPEN_NODE:90 locfs_open_node(callid, &call);91 break;92 case VFS_OUT_STAT:93 locfs_stat(callid, &call);94 break;95 case VFS_OUT_READ:96 locfs_read(callid, &call);97 break;98 case VFS_OUT_WRITE:99 locfs_write(callid, &call);100 break;101 case VFS_OUT_TRUNCATE:102 locfs_truncate(callid, &call);103 break;104 case VFS_OUT_CLOSE:105 locfs_close(callid, &call);106 break;107 case VFS_OUT_SYNC:108 locfs_sync(callid, &call);109 break;110 case VFS_OUT_DESTROY:111 locfs_destroy(callid, &call);112 break;113 default:114 async_answer_0(callid, ENOTSUP);115 break;116 }117 }118 }119 120 59 int main(int argc, char *argv[]) 121 60 { … … 134 73 } 135 74 136 int rc = fs_register(vfs_sess, &locfs_ reg, &locfs_vfs_info,137 locfs_connection);75 int rc = fs_register(vfs_sess, &locfs_vfs_info, &locfs_ops, 76 &locfs_libfs_ops); 138 77 if (rc != EOK) { 139 78 printf("%s: Failed to register file system (%d)\n", NAME, rc); … … 152 91 * @} 153 92 */ 93 -
uspace/srv/fs/locfs/locfs.h
r15f3c3f r86ffa27f 36 36 #include <libfs.h> 37 37 38 extern fs_reg_t locfs_reg; 38 extern vfs_out_ops_t locfs_ops; 39 extern libfs_ops_t locfs_libfs_ops; 39 40 40 41 #endif -
uspace/srv/fs/locfs/locfs_ops.c
r15f3c3f r86ffa27f 404 404 } 405 405 406 static char locfs_plb_get_char(unsigned pos)407 {408 return locfs_reg.plb_ro[pos % PLB_SIZE];409 }410 411 406 static bool locfs_is_directory(fs_node_t *fn) 412 407 { … … 448 443 .size_get = locfs_size_get, 449 444 .lnkcnt_get = locfs_lnkcnt_get, 450 .plb_get_char = locfs_plb_get_char,451 445 .is_directory = locfs_is_directory, 452 446 .is_file = locfs_is_file, … … 463 457 } 464 458 465 void locfs_mounted(ipc_callid_t rid, ipc_call_t *request) 466 { 467 char *opts; 468 469 /* Accept the mount options */ 470 sysarg_t retval = async_data_write_accept((void **) &opts, true, 0, 0, 471 0, NULL); 472 if (retval != EOK) { 473 async_answer_0(rid, retval); 474 return; 475 } 476 477 free(opts); 478 async_answer_3(rid, EOK, 0, 0, 0); 479 } 480 481 void locfs_mount(ipc_callid_t rid, ipc_call_t *request) 482 { 483 libfs_mount(&locfs_libfs_ops, locfs_reg.fs_handle, rid, request); 484 } 485 486 void locfs_unmounted(ipc_callid_t rid, ipc_call_t *request) 487 { 488 async_answer_0(rid, ENOTSUP); 489 } 490 491 void locfs_unmount(ipc_callid_t rid, ipc_call_t *request) 492 { 493 libfs_unmount(&locfs_libfs_ops, rid, request); 494 } 495 496 void locfs_lookup(ipc_callid_t rid, ipc_call_t *request) 497 { 498 libfs_lookup(&locfs_libfs_ops, locfs_reg.fs_handle, rid, request); 499 } 500 501 void locfs_open_node(ipc_callid_t rid, ipc_call_t *request) 502 { 503 libfs_open_node(&locfs_libfs_ops, locfs_reg.fs_handle, rid, request); 504 } 505 506 void locfs_stat(ipc_callid_t rid, ipc_call_t *request) 507 { 508 libfs_stat(&locfs_libfs_ops, locfs_reg.fs_handle, rid, request); 509 } 510 511 void locfs_read(ipc_callid_t rid, ipc_call_t *request) 512 { 513 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); 514 aoff64_t pos = 515 (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*request), IPC_GET_ARG4(*request)); 516 459 static int locfs_mounted(service_id_t service_id, const char *opts, 460 fs_index_t *index, aoff64_t *size, unsigned *lnkcnt) 461 { 462 *index = 0; 463 *size = 0; 464 *lnkcnt = 0; 465 return EOK; 466 } 467 468 static int locfs_unmounted(service_id_t service_id) 469 { 470 return ENOTSUP; 471 } 472 473 static int 474 locfs_read(service_id_t service_id, fs_index_t index, aoff64_t pos, 475 size_t *rbytes) 476 { 517 477 if (index == 0) { 518 478 ipc_callid_t callid; … … 520 480 if (!async_data_read_receive(&callid, &size)) { 521 481 async_answer_0(callid, EINVAL); 522 async_answer_0(rid, EINVAL); 523 return; 482 return EINVAL; 524 483 } 525 484 … … 541 500 async_data_read_finalize(callid, desc[pos].name, str_size(desc[pos].name) + 1); 542 501 free(desc); 543 async_answer_1(rid, EOK, 1);544 return ;502 *rbytes = 1; 503 return EOK; 545 504 } 546 505 … … 556 515 async_data_read_finalize(callid, desc[pos].name, str_size(desc[pos].name) + 1); 557 516 free(desc); 558 async_answer_1(rid, EOK, 1);559 return ;517 *rbytes = 1; 518 return EOK; 560 519 } 561 520 … … 564 523 565 524 async_answer_0(callid, ENOENT); 566 async_answer_1(rid, ENOENT, 0); 567 return; 525 return ENOENT; 568 526 } 569 527 … … 576 534 if (!async_data_read_receive(&callid, &size)) { 577 535 async_answer_0(callid, EINVAL); 578 async_answer_0(rid, EINVAL); 579 return; 536 return EINVAL; 580 537 } 581 538 … … 586 543 async_data_read_finalize(callid, desc[pos].name, str_size(desc[pos].name) + 1); 587 544 free(desc); 588 async_answer_1(rid, EOK, 1);589 return ;545 *rbytes = 1; 546 return EOK; 590 547 } 591 548 592 549 free(desc); 593 550 async_answer_0(callid, ENOENT); 594 async_answer_1(rid, ENOENT, 0); 595 return; 551 return ENOENT; 596 552 } 597 553 … … 607 563 if (lnk == NULL) { 608 564 fibril_mutex_unlock(&services_mutex); 609 async_answer_0(rid, ENOENT); 610 return; 565 return ENOENT; 611 566 } 612 567 … … 618 573 fibril_mutex_unlock(&services_mutex); 619 574 async_answer_0(callid, EINVAL); 620 async_answer_0(rid, EINVAL); 621 return; 575 return EINVAL; 622 576 } 623 577 … … 626 580 627 581 ipc_call_t answer; 628 aid_t msg = async_send_3(exch, IPC_GET_IMETHOD(*request), 629 IPC_GET_ARG1(*request), IPC_GET_ARG2(*request), 630 IPC_GET_ARG3(*request), &answer); 582 aid_t msg = async_send_4(exch, VFS_OUT_READ, service_id, 583 index, LOWER32(pos), UPPER32(pos), &answer); 631 584 632 585 /* Forward the IPC_M_DATA_READ request to the driver */ … … 640 593 sysarg_t rc; 641 594 async_wait_for(msg, &rc); 642 size_t bytes = IPC_GET_ARG1(answer); 643 644 /* Driver reply is the final result of the whole operation */ 645 async_answer_1(rid, rc, bytes); 646 return; 647 } 648 649 async_answer_0(rid, ENOENT); 650 } 651 652 void locfs_write(ipc_callid_t rid, ipc_call_t *request) 653 { 654 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); 655 if (index == 0) { 656 async_answer_0(rid, ENOTSUP); 657 return; 658 } 595 596 *rbytes = IPC_GET_ARG1(answer); 597 return rc; 598 } 599 600 return ENOENT; 601 } 602 603 static int 604 locfs_write(service_id_t service_id, fs_index_t index, aoff64_t pos, 605 size_t *wbytes, aoff64_t *nsize) 606 { 607 if (index == 0) 608 return ENOTSUP; 659 609 660 610 loc_object_type_t type = loc_id_probe(index); … … 662 612 if (type == LOC_OBJECT_NAMESPACE) { 663 613 /* Namespace directory */ 664 async_answer_0(rid, ENOTSUP); 665 return; 614 return ENOTSUP; 666 615 } 667 616 … … 676 625 if (lnk == NULL) { 677 626 fibril_mutex_unlock(&services_mutex); 678 async_answer_0(rid, ENOENT); 679 return; 627 return ENOENT; 680 628 } 681 629 … … 687 635 fibril_mutex_unlock(&services_mutex); 688 636 async_answer_0(callid, EINVAL); 689 async_answer_0(rid, EINVAL); 690 return; 637 return EINVAL; 691 638 } 692 639 … … 695 642 696 643 ipc_call_t answer; 697 aid_t msg = async_send_3(exch, IPC_GET_IMETHOD(*request), 698 IPC_GET_ARG1(*request), IPC_GET_ARG2(*request), 699 IPC_GET_ARG3(*request), &answer); 644 aid_t msg = async_send_4(exch, VFS_OUT_WRITE, service_id, 645 index, LOWER32(pos), UPPER32(pos), &answer); 700 646 701 647 /* Forward the IPC_M_DATA_WRITE request to the driver */ … … 709 655 sysarg_t rc; 710 656 async_wait_for(msg, &rc); 711 size_t bytes = IPC_GET_ARG1(answer); 712 713 /* Driver reply is the final result of the whole operation */ 714 async_answer_1(rid, rc, bytes); 715 return; 716 } 717 718 async_answer_0(rid, ENOENT); 719 } 720 721 void locfs_truncate(ipc_callid_t rid, ipc_call_t *request) 722 { 723 async_answer_0(rid, ENOTSUP); 724 } 725 726 void locfs_close(ipc_callid_t rid, ipc_call_t *request) 727 { 728 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); 729 730 if (index == 0) { 731 async_answer_0(rid, EOK); 732 return; 733 } 657 658 *wbytes = IPC_GET_ARG1(answer); 659 *nsize = 0; 660 return rc; 661 } 662 663 return ENOENT; 664 } 665 666 static int 667 locfs_truncate(service_id_t service_id, fs_index_t index, aoff64_t size) 668 { 669 return ENOTSUP; 670 } 671 672 static int locfs_close(service_id_t service_id, fs_index_t index) 673 { 674 if (index == 0) 675 return EOK; 734 676 735 677 loc_object_type_t type = loc_id_probe(index); … … 737 679 if (type == LOC_OBJECT_NAMESPACE) { 738 680 /* Namespace directory */ 739 async_answer_0(rid, EOK); 740 return; 681 return EOK; 741 682 } 742 683 … … 750 691 if (lnk == NULL) { 751 692 fibril_mutex_unlock(&services_mutex); 752 async_answer_0(rid, ENOENT); 753 return; 693 return ENOENT; 754 694 } 755 695 … … 765 705 fibril_mutex_unlock(&services_mutex); 766 706 767 async_answer_0(rid, EOK); 768 return; 769 } 770 771 async_answer_0(rid, ENOENT); 772 } 773 774 void locfs_sync(ipc_callid_t rid, ipc_call_t *request) 775 { 776 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); 777 778 if (index == 0) { 779 async_answer_0(rid, EOK); 780 return; 781 } 707 return EOK; 708 } 709 710 return ENOENT; 711 } 712 713 static int locfs_sync(service_id_t service_id, fs_index_t index) 714 { 715 if (index == 0) 716 return EOK; 782 717 783 718 loc_object_type_t type = loc_id_probe(index); … … 785 720 if (type == LOC_OBJECT_NAMESPACE) { 786 721 /* Namespace directory */ 787 async_answer_0(rid, EOK); 788 return; 722 return EOK; 789 723 } 790 724 … … 798 732 if (lnk == NULL) { 799 733 fibril_mutex_unlock(&services_mutex); 800 async_answer_0(rid, ENOENT); 801 return; 734 return ENOENT; 802 735 } 803 736 … … 809 742 810 743 ipc_call_t answer; 811 aid_t msg = async_send_2(exch, IPC_GET_IMETHOD(*request),812 IPC_GET_ARG1(*request), IPC_GET_ARG2(*request), &answer);744 aid_t msg = async_send_2(exch, VFS_OUT_SYNC, service_id, 745 index, &answer); 813 746 814 747 async_exchange_end(exch); … … 820 753 async_wait_for(msg, &rc); 821 754 822 /* Driver reply is the final result of the whole operation */ 823 async_answer_0(rid, rc); 824 return; 825 } 826 827 async_answer_0(rid, ENOENT); 828 } 829 830 void locfs_destroy(ipc_callid_t rid, ipc_call_t *request) 831 { 832 async_answer_0(rid, ENOTSUP); 833 } 755 return rc; 756 } 757 758 return ENOENT; 759 } 760 761 static int locfs_destroy(service_id_t service_id, fs_index_t index) 762 { 763 return ENOTSUP; 764 } 765 766 vfs_out_ops_t locfs_ops = { 767 .mounted = locfs_mounted, 768 .unmounted = locfs_unmounted, 769 .read = locfs_read, 770 .write = locfs_write, 771 .truncate = locfs_truncate, 772 .close = locfs_close, 773 .destroy = locfs_destroy, 774 .sync = locfs_sync, 775 }; 834 776 835 777 /** -
uspace/srv/fs/locfs/locfs_ops.h
r15f3c3f r86ffa27f 34 34 #define LOCFS_LOCFS_OPS_H_ 35 35 36 #include <ipc/common.h>37 36 #include <bool.h> 38 37 39 38 extern bool locfs_init(void); 40 41 extern void locfs_mounted(ipc_callid_t, ipc_call_t *);42 extern void locfs_mount(ipc_callid_t, ipc_call_t *);43 extern void locfs_unmounted(ipc_callid_t, ipc_call_t *);44 extern void locfs_unmount(ipc_callid_t, ipc_call_t *);45 extern void locfs_lookup(ipc_callid_t, ipc_call_t *);46 extern void locfs_open_node(ipc_callid_t, ipc_call_t *);47 extern void locfs_stat(ipc_callid_t, ipc_call_t *);48 extern void locfs_sync(ipc_callid_t, ipc_call_t *);49 extern void locfs_read(ipc_callid_t, ipc_call_t *);50 extern void locfs_write(ipc_callid_t, ipc_call_t *);51 extern void locfs_truncate(ipc_callid_t, ipc_call_t *);52 extern void locfs_close(ipc_callid_t, ipc_call_t *);53 extern void locfs_destroy(ipc_callid_t, ipc_call_t *);54 39 55 40 #endif -
uspace/srv/fs/tmpfs/tmpfs.c
r15f3c3f r86ffa27f 61 61 }; 62 62 63 fs_reg_t tmpfs_reg;64 65 /**66 * This connection fibril processes VFS requests from VFS.67 *68 * In order to support simultaneous VFS requests, our design is as follows.69 * The connection fibril accepts VFS requests from VFS. If there is only one70 * instance of the fibril, VFS will need to serialize all VFS requests it sends71 * to FAT. To overcome this bottleneck, VFS can send TMPFS the72 * IPC_M_CONNECT_ME_TO call. In that case, a new connection fibril will be73 * created, which in turn will accept the call. Thus, a new phone will be74 * opened for VFS.75 *76 * There are few issues with this arrangement. First, VFS can run out of77 * available phones. In that case, VFS can close some other phones or use one78 * phone for more serialized requests. Similarily, TMPFS can refuse to duplicate79 * the connection. VFS should then just make use of already existing phones and80 * route its requests through them. To avoid paying the fibril creation price81 * upon each request, TMPFS might want to keep the connections open after the82 * request has been completed.83 */84 static void tmpfs_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg)85 {86 if (iid) {87 /*88 * This only happens for connections opened by89 * IPC_M_CONNECT_ME_TO calls as opposed to callback connections90 * created by IPC_M_CONNECT_TO_ME.91 */92 async_answer_0(iid, EOK);93 }94 95 dprintf(NAME ": connection opened\n");96 97 while (true) {98 ipc_call_t call;99 ipc_callid_t callid = async_get_call(&call);100 101 if (!IPC_GET_IMETHOD(call))102 return;103 104 switch (IPC_GET_IMETHOD(call)) {105 case VFS_OUT_MOUNTED:106 tmpfs_mounted(callid, &call);107 break;108 case VFS_OUT_MOUNT:109 tmpfs_mount(callid, &call);110 break;111 case VFS_OUT_UNMOUNTED:112 tmpfs_unmounted(callid, &call);113 break;114 case VFS_OUT_UNMOUNT:115 tmpfs_unmount(callid, &call);116 break;117 case VFS_OUT_LOOKUP:118 tmpfs_lookup(callid, &call);119 break;120 case VFS_OUT_READ:121 tmpfs_read(callid, &call);122 break;123 case VFS_OUT_WRITE:124 tmpfs_write(callid, &call);125 break;126 case VFS_OUT_TRUNCATE:127 tmpfs_truncate(callid, &call);128 break;129 case VFS_OUT_CLOSE:130 tmpfs_close(callid, &call);131 break;132 case VFS_OUT_DESTROY:133 tmpfs_destroy(callid, &call);134 break;135 case VFS_OUT_OPEN_NODE:136 tmpfs_open_node(callid, &call);137 break;138 case VFS_OUT_STAT:139 tmpfs_stat(callid, &call);140 break;141 case VFS_OUT_SYNC:142 tmpfs_sync(callid, &call);143 break;144 default:145 async_answer_0(callid, ENOTSUP);146 break;147 }148 }149 }150 151 63 int main(int argc, char **argv) 152 64 { … … 165 77 } 166 78 167 int rc = fs_register(vfs_sess, &tmpfs_ reg, &tmpfs_vfs_info,168 tmpfs_connection);79 int rc = fs_register(vfs_sess, &tmpfs_vfs_info, &tmpfs_ops, 80 &tmpfs_libfs_ops); 169 81 if (rc != EOK) { 170 82 printf(NAME ": Failed to register file system (%d)\n", rc); -
uspace/srv/fs/tmpfs/tmpfs.h
r15f3c3f r86ffa27f 70 70 } tmpfs_node_t; 71 71 72 extern fs_reg_t tmpfs_reg; 73 72 extern vfs_out_ops_t tmpfs_ops; 74 73 extern libfs_ops_t tmpfs_libfs_ops; 75 74 76 75 extern bool tmpfs_init(void); 77 78 extern void tmpfs_mounted(ipc_callid_t, ipc_call_t *);79 extern void tmpfs_mount(ipc_callid_t, ipc_call_t *);80 extern void tmpfs_unmounted(ipc_callid_t, ipc_call_t *);81 extern void tmpfs_unmount(ipc_callid_t, ipc_call_t *);82 extern void tmpfs_lookup(ipc_callid_t, ipc_call_t *);83 extern void tmpfs_read(ipc_callid_t, ipc_call_t *);84 extern void tmpfs_write(ipc_callid_t, ipc_call_t *);85 extern void tmpfs_truncate(ipc_callid_t, ipc_call_t *);86 extern void tmpfs_stat(ipc_callid_t, ipc_call_t *);87 extern void tmpfs_close(ipc_callid_t, ipc_call_t *);88 extern void tmpfs_destroy(ipc_callid_t, ipc_call_t *);89 extern void tmpfs_open_node(ipc_callid_t, ipc_call_t *);90 extern void tmpfs_sync(ipc_callid_t, ipc_call_t *);91 92 76 extern bool tmpfs_restore(service_id_t); 93 77 -
uspace/srv/fs/tmpfs/tmpfs_ops.c
r15f3c3f r86ffa27f 104 104 } 105 105 106 static char tmpfs_plb_get_char(unsigned pos)107 {108 return tmpfs_reg.plb_ro[pos % PLB_SIZE];109 }110 111 106 static bool tmpfs_is_directory(fs_node_t *fn) 112 107 { … … 139 134 .size_get = tmpfs_size_get, 140 135 .lnkcnt_get = tmpfs_lnkcnt_get, 141 .plb_get_char = tmpfs_plb_get_char,142 136 .is_directory = tmpfs_is_directory, 143 137 .is_file = tmpfs_is_file, … … 433 427 } 434 428 435 void tmpfs_mounted(ipc_callid_t rid, ipc_call_t *request) 436 { 437 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request); 429 /* 430 * Implementation of the VFS_OUT interface. 431 */ 432 433 static int 434 tmpfs_mounted(service_id_t service_id, const char *opts, 435 fs_index_t *index, aoff64_t *size, unsigned *lnkcnt) 436 { 438 437 fs_node_t *rootfn; 439 438 int rc; 440 439 441 /* Accept the mount options. */442 char *opts;443 rc = async_data_write_accept((void **) &opts, true, 0, 0, 0, NULL);444 if (rc != EOK) {445 async_answer_0(rid, rc);446 return;447 }448 449 440 /* Check if this device is not already mounted. */ 450 441 rc = tmpfs_root_get(&rootfn, service_id); 451 442 if ((rc == EOK) && (rootfn)) { 452 443 (void) tmpfs_node_put(rootfn); 453 free(opts); 454 async_answer_0(rid, EEXIST); 455 return; 444 return EEXIST; 456 445 } 457 446 458 447 /* Initialize TMPFS instance. */ 459 if (!tmpfs_instance_init(service_id)) { 460 free(opts); 461 async_answer_0(rid, ENOMEM); 462 return; 463 } 448 if (!tmpfs_instance_init(service_id)) 449 return ENOMEM; 464 450 465 451 rc = tmpfs_root_get(&rootfn, service_id); … … 467 453 tmpfs_node_t *rootp = TMPFS_NODE(rootfn); 468 454 if (str_cmp(opts, "restore") == 0) { 469 if (tmpfs_restore(service_id)) 470 async_answer_3(rid, EOK, rootp->index, rootp->size, 471 rootp->lnkcnt); 472 else 473 async_answer_0(rid, ELIMIT); 474 } else { 475 async_answer_3(rid, EOK, rootp->index, rootp->size, 476 rootp->lnkcnt); 477 } 478 free(opts); 479 } 480 481 void tmpfs_mount(ipc_callid_t rid, ipc_call_t *request) 482 { 483 libfs_mount(&tmpfs_libfs_ops, tmpfs_reg.fs_handle, rid, request); 484 } 485 486 void tmpfs_unmounted(ipc_callid_t rid, ipc_call_t *request) 487 { 488 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request); 489 455 if (!tmpfs_restore(service_id)) 456 return ELIMIT; 457 } 458 459 *index = rootp->index; 460 *size = rootp->size; 461 *lnkcnt = rootp->lnkcnt; 462 463 return EOK; 464 } 465 466 static int tmpfs_unmounted(service_id_t service_id) 467 { 490 468 tmpfs_instance_done(service_id); 491 async_answer_0(rid, EOK); 492 } 493 494 void tmpfs_unmount(ipc_callid_t rid, ipc_call_t *request) 495 { 496 libfs_unmount(&tmpfs_libfs_ops, rid, request); 497 } 498 499 void tmpfs_lookup(ipc_callid_t rid, ipc_call_t *request) 500 { 501 libfs_lookup(&tmpfs_libfs_ops, tmpfs_reg.fs_handle, rid, request); 502 } 503 504 void tmpfs_read(ipc_callid_t rid, ipc_call_t *request) 505 { 506 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request); 507 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); 508 aoff64_t pos = 509 (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*request), IPC_GET_ARG4(*request)); 510 469 return EOK; 470 } 471 472 static int tmpfs_read(service_id_t service_id, fs_index_t index, aoff64_t pos, 473 size_t *rbytes) 474 { 511 475 /* 512 476 * Lookup the respective TMPFS node. … … 518 482 }; 519 483 hlp = hash_table_find(&nodes, key); 520 if (!hlp) { 521 async_answer_0(rid, ENOENT); 522 return; 523 } 484 if (!hlp) 485 return ENOENT; 524 486 tmpfs_node_t *nodep = hash_table_get_instance(hlp, tmpfs_node_t, 525 487 nh_link); … … 532 494 if (!async_data_read_receive(&callid, &size)) { 533 495 async_answer_0(callid, EINVAL); 534 async_answer_0(rid, EINVAL); 535 return; 496 return EINVAL; 536 497 } 537 498 … … 556 517 if (lnk == NULL) { 557 518 async_answer_0(callid, ENOENT); 558 async_answer_1(rid, ENOENT, 0); 559 return; 519 return ENOENT; 560 520 } 561 521 … … 567 527 } 568 528 569 /* 570 * Answer the VFS_READ call. 571 */ 572 async_answer_1(rid, EOK, bytes); 573 } 574 575 void tmpfs_write(ipc_callid_t rid, ipc_call_t *request) 576 { 577 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request); 578 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); 579 aoff64_t pos = 580 (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*request), IPC_GET_ARG4(*request)); 581 529 *rbytes = bytes; 530 return EOK; 531 } 532 533 static int 534 tmpfs_write(service_id_t service_id, fs_index_t index, aoff64_t pos, 535 size_t *wbytes, aoff64_t *nsize) 536 { 582 537 /* 583 538 * Lookup the respective TMPFS node. … … 589 544 }; 590 545 hlp = hash_table_find(&nodes, key); 591 if (!hlp) { 592 async_answer_0(rid, ENOENT); 593 return; 594 } 546 if (!hlp) 547 return ENOENT; 595 548 tmpfs_node_t *nodep = hash_table_get_instance(hlp, tmpfs_node_t, 596 549 nh_link); … … 603 556 if (!async_data_write_receive(&callid, &size)) { 604 557 async_answer_0(callid, EINVAL); 605 async_answer_0(rid, EINVAL); 606 return; 558 return EINVAL; 607 559 } 608 560 … … 612 564 if (pos + size <= nodep->size) { 613 565 /* The file size is not changing. */ 614 (void) async_data_write_finalize(callid, nodep->data + pos, size);615 async_answer_2(rid, EOK, size, nodep->size);616 return;566 (void) async_data_write_finalize(callid, nodep->data + pos, 567 size); 568 goto out; 617 569 } 618 570 size_t delta = (pos + size) - nodep->size; … … 627 579 if (!newdata) { 628 580 async_answer_0(callid, ENOMEM); 629 async_answer_2(rid, EOK, 0, nodep->size);630 return;581 size = 0; 582 goto out; 631 583 } 632 584 /* Clear any newly allocated memory in order to emulate gaps. */ … … 635 587 nodep->data = newdata; 636 588 (void) async_data_write_finalize(callid, nodep->data + pos, size); 637 async_answer_2(rid, EOK, size, nodep->size); 638 } 639 640 void tmpfs_truncate(ipc_callid_t rid, ipc_call_t *request) 641 { 642 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request); 643 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); 644 aoff64_t size = 645 (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*request), IPC_GET_ARG4(*request)); 646 589 590 out: 591 *wbytes = size; 592 *nsize = nodep->size; 593 return EOK; 594 } 595 596 static int tmpfs_truncate(service_id_t service_id, fs_index_t index, 597 aoff64_t size) 598 { 647 599 /* 648 600 * Lookup the respective TMPFS node. … … 653 605 }; 654 606 link_t *hlp = hash_table_find(&nodes, key); 655 if (!hlp) { 656 async_answer_0(rid, ENOENT); 657 return; 658 } 659 tmpfs_node_t *nodep = hash_table_get_instance(hlp, tmpfs_node_t, 660 nh_link); 661 662 if (size == nodep->size) { 663 async_answer_0(rid, EOK); 664 return; 665 } 666 667 if (size > SIZE_MAX) { 668 async_answer_0(rid, ENOMEM); 669 return; 670 } 607 if (!hlp) 608 return ENOENT; 609 tmpfs_node_t *nodep = hash_table_get_instance(hlp, tmpfs_node_t, nh_link); 610 611 if (size == nodep->size) 612 return EOK; 613 614 if (size > SIZE_MAX) 615 return ENOMEM; 671 616 672 617 void *newdata = realloc(nodep->data, size); 673 if (!newdata) { 674 async_answer_0(rid, ENOMEM); 675 return; 676 } 618 if (!newdata) 619 return ENOMEM; 677 620 678 621 if (size > nodep->size) { … … 683 626 nodep->size = size; 684 627 nodep->data = newdata; 685 async_answer_0(rid, EOK); 686 } 687 688 void tmpfs_close(ipc_callid_t rid, ipc_call_t *request) 689 { 690 async_answer_0(rid, EOK); 691 } 692 693 void tmpfs_destroy(ipc_callid_t rid, ipc_call_t *request) 694 { 695 service_id_t service_id = (service_id_t)IPC_GET_ARG1(*request); 696 fs_index_t index = (fs_index_t)IPC_GET_ARG2(*request); 697 int rc; 698 628 return EOK; 629 } 630 631 static int tmpfs_close(service_id_t service_id, fs_index_t index) 632 { 633 return EOK; 634 } 635 636 static int tmpfs_destroy(service_id_t service_id, fs_index_t index) 637 { 699 638 link_t *hlp; 700 639 unsigned long key[] = { … … 703 642 }; 704 643 hlp = hash_table_find(&nodes, key); 705 if (!hlp) { 706 async_answer_0(rid, ENOENT); 707 return; 708 } 644 if (!hlp) 645 return ENOENT; 709 646 tmpfs_node_t *nodep = hash_table_get_instance(hlp, tmpfs_node_t, 710 647 nh_link); 711 rc = tmpfs_destroy_node(FS_NODE(nodep)); 712 async_answer_0(rid, rc); 713 } 714 715 void tmpfs_open_node(ipc_callid_t rid, ipc_call_t *request) 716 { 717 libfs_open_node(&tmpfs_libfs_ops, tmpfs_reg.fs_handle, rid, request); 718 } 719 720 void tmpfs_stat(ipc_callid_t rid, ipc_call_t *request) 721 { 722 libfs_stat(&tmpfs_libfs_ops, tmpfs_reg.fs_handle, rid, request); 723 } 724 725 void tmpfs_sync(ipc_callid_t rid, ipc_call_t *request) 648 return tmpfs_destroy_node(FS_NODE(nodep)); 649 } 650 651 static int tmpfs_sync(service_id_t service_id, fs_index_t index) 726 652 { 727 653 /* … … 729 655 * thus the sync operation is a no-op. 730 656 */ 731 async_answer_0(rid, EOK); 732 } 657 return EOK; 658 } 659 660 vfs_out_ops_t tmpfs_ops = { 661 .mounted = tmpfs_mounted, 662 .unmounted = tmpfs_unmounted, 663 .read = tmpfs_read, 664 .write = tmpfs_write, 665 .truncate = tmpfs_truncate, 666 .close = tmpfs_close, 667 .destroy = tmpfs_destroy, 668 .sync = tmpfs_sync, 669 }; 733 670 734 671 /** 735 672 * @} 736 673 */ 674 -
uspace/srv/hid/console/console.c
r15f3c3f r86ffa27f 357 357 console_serialize_end(); 358 358 359 if ( __SYSCALL0(SYS_DEBUG_ENABLE_CONSOLE)) {359 if (console_kcon()) { 360 360 prev_console = active_console; 361 361 active_console = kernel_console; … … 711 711 console_serialize_start(); 712 712 continue; 713 case CONSOLE_KCON_ENABLE:714 change_console(kernel_console);715 break;716 713 } 717 714 async_answer_3(callid, EOK, arg1, arg2, arg3); … … 833 830 } 834 831 835 /* Disable kernel output to the console */836 __SYSCALL0(SYS_DEBUG_DISABLE_CONSOLE);837 838 832 /* Initialize the screen */ 839 833 console_serialize_start(); -
uspace/srv/hid/fb/Makefile
r15f3c3f r86ffa27f 84 84 EXTRA_CFLAGS += -DNIAGARA_ENABLED 85 85 endif 86 87 ifeq ($(MACHINE),serengeti)88 SOURCES += \89 sgcn.c \90 serial_console.c91 EXTRA_CFLAGS += -DSGCN_ENABLED92 endif93 86 endif 94 87 -
uspace/srv/hid/fb/main.c
r15f3c3f r86ffa27f 40 40 #include "msim.h" 41 41 #include "ski.h" 42 #include "sgcn.h"43 42 #include "niagara.h" 44 43 #include "main.h" … … 92 91 } 93 92 #endif 94 #ifdef SGCN_ENABLED95 if ((!initialized) && (fb_kind == 4)) {96 if (sgcn_init() == 0)97 initialized = true;98 }99 #endif100 93 #ifdef NIAGARA_ENABLED 101 94 if ((!initialized) && (fb_kind == 5)) { -
uspace/srv/hid/fb/niagara.c
r15f3c3f r86ffa27f 29 29 */ 30 30 31 /** @defgroup niagarafb SGCN31 /** @defgroup niagarafb 32 32 * @brief userland driver of the Niagara console output 33 33 * @{ -
uspace/srv/hid/fb/niagara.h
r15f3c3f r86ffa27f 27 27 */ 28 28 29 /** @defgroup sgcnfb SGCN30 * @brief userland driver of the Serengeticonsole output29 /** @defgroup niagarafb 30 * @brief userland driver of the Niagara console output 31 31 * @{ 32 32 */ -
uspace/srv/hid/input/Makefile
r15f3c3f r86ffa27f 49 49 port/ns16550.c \ 50 50 port/pl050.c \ 51 port/sgcn.c \52 51 port/ski.c \ 53 port/z8530.c \54 52 proto/adb.c \ 55 53 proto/mousedev.c \ -
uspace/srv/hid/input/ctl/stty.c
r15f3c3f r86ffa27f 34 34 * @file 35 35 * @brief Serial TTY-like keyboard controller driver. 36 * 37 * Keyboard emulation on a serial terminal. 36 38 */ 37 39 … … 63 65 #include <stdio.h> 64 66 67 /** 68 * Sequnece definitions are primarily for Xterm. Additionally we define 69 * sequences that are unique to Gnome terminal -- most are the same but 70 * some differ. 71 */ 65 72 static int seq_defs[] = { 66 73 /* Not shifted */ … … 81 88 0, KC_MINUS, 0x2d, GSP_END, 82 89 0, KC_EQUALS, 0x3d, GSP_END, 90 83 91 0, KC_BACKSPACE, 0x08, GSP_END, 84 92 … … 216 224 0, KC_RIGHT, 0x1b, 0x5b, 0x43, GSP_END, 217 225 226 /* 227 * Sequences specific to Gnome terminal 228 */ 229 0, KC_BACKSPACE, 0x7f, GSP_END, /* ASCII DEL */ 230 0, KC_HOME, 0x1b, 0x4f, 0x48, GSP_END, 231 0, KC_END, 0x1b, 0x4f, 0x46, GSP_END, 232 218 233 0, 0 219 234 }; -
uspace/srv/hid/input/generic/gsp.c
r15f3c3f r86ffa27f 104 104 if (key == 0) break; 105 105 106 /* Insert one sequence. */ 106 /* Insert one sequence. */ 107 107 rc = gsp_insert_seq(p, dp, mods, key); 108 108 if (rc != 0) … … 197 197 198 198 if (t == NULL) { 199 printf("gsp_step: not found\n"); 199 printf("gsp_step: not found, state=%d, input=0x%x\n", 200 state, input); 200 201 *mods = 0; 201 202 *key = 0; … … 205 206 *mods = t->out_mods; 206 207 *key = t->out_key; 208 207 209 return t->new_state; 208 210 } -
uspace/srv/hid/input/generic/input.c
r15f3c3f r86ffa27f 410 410 #endif 411 411 #if defined(MACHINE_msim) 412 kbd_add_dev(&msim_port, & pc_ctl);412 kbd_add_dev(&msim_port, &stty_ctl); 413 413 #endif 414 414 #if (defined(MACHINE_lgxemul) || defined(MACHINE_bgxemul)) && defined(CONFIG_FB) … … 424 424 kbd_add_dev(&niagara_port, &stty_ctl); 425 425 #endif 426 #if defined(UARCH_sparc64) && defined(MACHINE_serengeti)427 kbd_add_dev(&sgcn_port, &stty_ctl);428 #endif429 426 #if defined(UARCH_sparc64) && defined(MACHINE_generic) 430 kbd_add_dev(&z8530_port, &sun_ctl);431 427 kbd_add_dev(&ns16550_port, &sun_ctl); 432 428 #endif … … 556 552 printf("%s: HelenOS input service\n", NAME); 557 553 558 sysarg_t fhc;559 554 sysarg_t obio; 560 555 … … 562 557 list_initialize(&mouse_devs); 563 558 564 if (((sysinfo_get_value("kbd.cir.fhc", &fhc) == EOK) && (fhc)) 565 || ((sysinfo_get_value("kbd.cir.obio", &obio) == EOK) && (obio))) 559 if ((sysinfo_get_value("kbd.cir.obio", &obio) == EOK) && (obio)) 566 560 irc_service = true; 567 561 -
uspace/srv/hid/input/include/kbd_port.h
r15f3c3f r86ffa27f 56 56 extern kbd_port_ops_t ns16550_port; 57 57 extern kbd_port_ops_t pl050_port; 58 extern kbd_port_ops_t sgcn_port;59 58 extern kbd_port_ops_t ski_port; 60 extern kbd_port_ops_t z8530_port;61 59 62 60 #endif -
uspace/srv/hid/input/port/niagara.c
r15f3c3f r86ffa27f 154 154 155 155 /** 156 * Thread to poll SGCNfor keypresses.156 * Thread to poll Niagara console for keypresses. 157 157 */ 158 158 static void niagara_thread_impl(void *arg) -
uspace/srv/hw/irc/apic/apic.c
r15f3c3f r86ffa27f 42 42 #include <as.h> 43 43 #include <ddi.h> 44 #include <libarch/ddi.h>45 #include <align.h>46 44 #include <bool.h> 47 45 #include <errno.h> 48 46 #include <async.h> 49 #include <align.h>50 #include <async.h>51 #include <stdio.h>52 #include <ipc/loc.h>53 47 54 48 #define NAME "apic" 55 49 50 #define APIC_MAX_IRQ 15 51 52 #define IOREGSEL (0x00U / sizeof(uint32_t)) 53 #define IOWIN (0x10U / sizeof(uint32_t)) 54 55 #define IOREDTBL 0x10U 56 57 /** I/O Register Select Register. */ 58 typedef union { 59 uint32_t value; 60 struct { 61 uint8_t reg_addr; /**< APIC Register Address. */ 62 unsigned int : 24; /**< Reserved. */ 63 } __attribute__ ((packed)); 64 } io_regsel_t; 65 66 /** I/O Redirection Register. */ 67 typedef struct io_redirection_reg { 68 union { 69 uint32_t lo; 70 struct { 71 uint8_t intvec; /**< Interrupt Vector. */ 72 unsigned int delmod : 3; /**< Delivery Mode. */ 73 unsigned int destmod : 1; /**< Destination mode. */ 74 unsigned int delivs : 1; /**< Delivery status (RO). */ 75 unsigned int intpol : 1; /**< Interrupt Input Pin Polarity. */ 76 unsigned int irr : 1; /**< Remote IRR (RO). */ 77 unsigned int trigger_mode : 1; /**< Trigger Mode. */ 78 unsigned int masked : 1; /**< Interrupt Mask. */ 79 unsigned int : 15; /**< Reserved. */ 80 } __attribute__ ((packed)); 81 }; 82 union { 83 uint32_t hi; 84 struct { 85 unsigned int : 24; /**< Reserved. */ 86 uint8_t dest : 8; /**< Destination Field. */ 87 } __attribute__ ((packed)); 88 }; 89 } __attribute__ ((packed)) io_redirection_reg_t; 90 91 // FIXME: get the address from the kernel 92 #define IO_APIC_BASE 0xfec00000UL 93 #define IO_APIC_SIZE 20 94 95 ioport32_t *io_apic = NULL; 96 97 /** Read from IO APIC register. 98 * 99 * @param address IO APIC register address. 100 * 101 * @return Content of the addressed IO APIC register. 102 * 103 */ 104 static uint32_t io_apic_read(uint8_t address) 105 { 106 io_regsel_t regsel; 107 108 regsel.value = io_apic[IOREGSEL]; 109 regsel.reg_addr = address; 110 io_apic[IOREGSEL] = regsel.value; 111 return io_apic[IOWIN]; 112 } 113 114 /** Write to IO APIC register. 115 * 116 * @param address IO APIC register address. 117 * @param val Content to be written to the addressed IO APIC register. 118 * 119 */ 120 static void io_apic_write(uint8_t address, uint32_t val) 121 { 122 io_regsel_t regsel; 123 124 regsel.value = io_apic[IOREGSEL]; 125 regsel.reg_addr = address; 126 io_apic[IOREGSEL] = regsel.value; 127 io_apic[IOWIN] = val; 128 } 129 130 static int irq_to_pin(int irq) 131 { 132 // FIXME: get the map from the kernel, even though this may work 133 // for simple cases 134 return irq; 135 } 136 56 137 static int apic_enable_irq(sysarg_t irq) 57 138 { 58 // FIXME: TODO 59 return ENOTSUP; 139 io_redirection_reg_t reg; 140 141 if (irq > APIC_MAX_IRQ) 142 return ELIMIT; 143 144 int pin = irq_to_pin(irq); 145 if (pin == -1) 146 return ENOENT; 147 148 reg.lo = io_apic_read((uint8_t) (IOREDTBL + pin * 2)); 149 reg.masked = false; 150 io_apic_write((uint8_t) (IOREDTBL + pin * 2), reg.lo); 151 152 return EOK; 60 153 } 61 154 … … 111 204 return false; 112 205 } 206 207 if (pio_enable((void *) IO_APIC_BASE, IO_APIC_SIZE, 208 (void **) &io_apic) != EOK) 209 return false; 113 210 114 211 async_set_client_connection(apic_connection); -
uspace/srv/hw/netif/ne2000/ne2000.c
r15f3c3f r86ffa27f 404 404 { 405 405 /* Start the module */ 406 return netif_module_start( SERVICE_ETHERNET);406 return netif_module_start(); 407 407 } 408 408 -
uspace/srv/loader/Makefile
r15f3c3f r86ffa27f 39 39 LINKER_SCRIPT = $(LIBC_PREFIX)/arch/$(UARCH)/_link-loader.ld 40 40 41 EXTRA_CFLAGS = -Iinclude42 43 41 BINARY = loader 44 42 STATIC_ONLY = y … … 46 44 GENERIC_SOURCES = \ 47 45 main.c \ 48 elf_load.c \49 46 interp.s 50 47 -
uspace/srv/loader/main.c
r15f3c3f r86ffa27f 59 59 #include <str.h> 60 60 #include <as.h> 61 #include <elf .h>62 #include <elf _load.h>61 #include <elf/elf.h> 62 #include <elf/elf_load.h> 63 63 64 64 #ifdef CONFIG_RTLD … … 348 348 349 349 /* Initialize list of loaded modules */ 350 list_initialize(&runtime_env->modules _head);351 list_append(&prog_mod.modules_link, &runtime_env->modules _head);350 list_initialize(&runtime_env->modules); 351 list_append(&prog_mod.modules_link, &runtime_env->modules); 352 352 353 353 /* Pointer to program module. Used as root of the module graph. */ -
uspace/srv/net/net/net.c
r15f3c3f r86ffa27f 479 479 480 480 /* Network interface layer startup */ 481 services_t internet_service; 481 482 if (netif->nil) { 482 483 setting = measured_strings_find(&netif->configuration, (uint8_t *) CONF_MTU, 0); … … 486 487 487 488 int mtu = setting ? strtol((char *) setting->value, NULL, 10) : 0; 488 489 rc = nil_device_req(netif->nil->sess, netif->id, mtu);489 rc = nil_device_req(netif->nil->sess, netif->id, mtu, 490 netif->driver->service); 490 491 if (rc != EOK) 491 492 return rc; 492 } 493 494 internet_service = netif->nil->service; 495 } else 496 internet_service = netif->driver->service; 493 497 494 498 /* Inter-network layer startup */ 495 rc = ip_device_req(netif->il->sess, netif->id );499 rc = ip_device_req(netif->il->sess, netif->id, internet_service); 496 500 if (rc != EOK) 497 501 return rc; -
uspace/srv/net/netif/lo/lo.c
r15f3c3f r86ffa27f 225 225 { 226 226 /* Start the module */ 227 return netif_module_start( SERVICE_NILDUMMY);227 return netif_module_start(); 228 228 } 229 229 -
uspace/srv/vfs/vfs_ops.c
r15f3c3f r86ffa27f 76 76 vfs_node_t *mr_node; 77 77 fs_index_t rindex; 78 size_t rsize;78 aoff64_t rsize; 79 79 unsigned rlnkcnt; 80 80 async_exch_t *exch; … … 146 146 147 147 rindex = (fs_index_t) IPC_GET_ARG1(answer); 148 rsize = ( size_t) IPC_GET_ARG2(answer);149 rlnkcnt = (unsigned) IPC_GET_ARG 3(answer);148 rsize = (aoff64_t) MERGE_LOUP32(IPC_GET_ARG2(answer), IPC_GET_ARG3(answer)); 149 rlnkcnt = (unsigned) IPC_GET_ARG4(answer); 150 150 151 151 mr_res.triplet.fs_handle = fs_handle; … … 229 229 if (rc == EOK) { 230 230 rindex = (fs_index_t) IPC_GET_ARG1(answer); 231 rsize = (size_t) IPC_GET_ARG2(answer); 232 rlnkcnt = (unsigned) IPC_GET_ARG3(answer); 231 rsize = (aoff64_t) MERGE_LOUP32(IPC_GET_ARG2(answer), 232 IPC_GET_ARG3(answer)); 233 rlnkcnt = (unsigned) IPC_GET_ARG4(answer); 233 234 234 235 mr_res.triplet.fs_handle = fs_handle; … … 795 796 ipc_call_t answer; 796 797 if (read) { 797 rc = async_data_read_forward_ 3_1(fs_exch, VFS_OUT_READ,798 file->node->service_id, file->node->index, file->pos,799 &answer);798 rc = async_data_read_forward_4_1(fs_exch, VFS_OUT_READ, 799 file->node->service_id, file->node->index, 800 LOWER32(file->pos), UPPER32(file->pos), &answer); 800 801 } else { 801 802 if (file->append) 802 803 file->pos = file->node->size; 803 804 804 rc = async_data_write_forward_ 3_1(fs_exch, VFS_OUT_WRITE,805 file->node->service_id, file->node->index, file->pos,806 &answer);805 rc = async_data_write_forward_4_1(fs_exch, VFS_OUT_WRITE, 806 file->node->service_id, file->node->index, 807 LOWER32(file->pos), UPPER32(file->pos), &answer); 807 808 } 808 809 … … 821 822 /* Update the cached version of node's size. */ 822 823 if (rc == EOK) 823 file->node->size = IPC_GET_ARG2(answer); 824 file->node->size = MERGE_LOUP32(IPC_GET_ARG2(answer), 825 IPC_GET_ARG3(answer)); 824 826 fibril_rwlock_write_unlock(&file->node->contents_rwlock); 825 827 }
Note:
See TracChangeset
for help on using the changeset viewer.