Changes in uspace/srv/fs/ext2fs/ext2fs_ops.c [b72efe8:b33870b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/ext2fs/ext2fs_ops.c
rb72efe8 rb33870b 1 1 /* 2 * Copyright (c) 2008 Jakub Jermar3 2 * Copyright (c) 2011 Martin Sucha 4 3 * All rights reserved. … … 43 42 #include <libext2.h> 44 43 #include <ipc/services.h> 45 #include <ipc/ devmap.h>44 #include <ipc/loc.h> 46 45 #include <macros.h> 47 46 #include <async.h> … … 70 69 typedef struct ext2fs_instance { 71 70 link_t link; 72 devmap_handle_t devmap_handle;71 service_id_t service_id; 73 72 ext2_filesystem_t *filesystem; 74 73 unsigned int open_nodes_count; … … 86 85 * Forward declarations of auxiliary functions 87 86 */ 88 static int ext2fs_instance_get( devmap_handle_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 *);87 static int ext2fs_instance_get(service_id_t, ext2fs_instance_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); … … 98 97 * Forward declarations of EXT2 libfs operations. 99 98 */ 100 static int ext2fs_root_get(fs_node_t **, devmap_handle_t);99 static int ext2fs_root_get(fs_node_t **, service_id_t); 101 100 static int ext2fs_match(fs_node_t **, fs_node_t *, const char *); 102 static int ext2fs_node_get(fs_node_t **, devmap_handle_t, fs_index_t);101 static int ext2fs_node_get(fs_node_t **, service_id_t, fs_index_t); 103 102 static int ext2fs_node_open(fs_node_t *); 104 103 static int ext2fs_node_put(fs_node_t *); 105 static int ext2fs_create_node(fs_node_t **, devmap_handle_t, int);104 static int ext2fs_create_node(fs_node_t **, service_id_t, int); 106 105 static int ext2fs_destroy_node(fs_node_t *); 107 106 static int ext2fs_link(fs_node_t *, fs_node_t *, const char *); … … 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); 116 static devmap_handle_t ext2fs_device_get(fs_node_t *node);114 static service_id_t ext2fs_service_get(fs_node_t *node); 117 115 118 116 /* … … 136 134 ext2fs_node_t *enode = hash_table_get_instance(item, ext2fs_node_t, link); 137 135 assert(keys > 0); 138 if (enode->instance-> devmap_handle!=139 (( devmap_handle_t) key[OPEN_NODES_DEV_HANDLE_KEY])) {136 if (enode->instance->service_id != 137 ((service_id_t) key[OPEN_NODES_DEV_HANDLE_KEY])) { 140 138 return false; 141 139 } … … 182 180 183 181 /** 184 * Find an instance of filesystem for the given devmap_handle185 */ 186 int ext2fs_instance_get( devmap_handle_t devmap_handle, ext2fs_instance_t **inst)187 { 188 EXT2FS_DBG("(%" PRIun ", -)", devmap_handle);182 * Find an instance of filesystem for the given service_id 183 */ 184 int ext2fs_instance_get(service_id_t service_id, ext2fs_instance_t **inst) 185 { 186 EXT2FS_DBG("(%" PRIun ", -)", service_id); 189 187 ext2fs_instance_t *tmp; 190 188 … … 200 198 tmp = list_get_instance(link, ext2fs_instance_t, link); 201 199 202 if (tmp-> devmap_handle == devmap_handle) {200 if (tmp->service_id == service_id) { 203 201 *inst = tmp; 204 202 fibril_mutex_unlock(&instance_list_mutex); … … 215 213 216 214 217 int ext2fs_root_get(fs_node_t **rfn, devmap_handle_t devmap_handle)218 { 219 EXT2FS_DBG("(-, %" PRIun ")", devmap_handle);220 return ext2fs_node_get(rfn, devmap_handle, EXT2_INODE_ROOT_INDEX);215 int ext2fs_root_get(fs_node_t **rfn, service_id_t service_id) 216 { 217 EXT2FS_DBG("(-, %" PRIun ")", service_id); 218 return ext2fs_node_get(rfn, service_id, EXT2_INODE_ROOT_INDEX); 221 219 } 222 220 … … 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; … … 291 289 292 290 /** Instantiate a EXT2 in-core node. */ 293 int ext2fs_node_get(fs_node_t **rfn, devmap_handle_t devmap_handle, fs_index_t index)294 { 295 EXT2FS_DBG("(-,%" PRIun ",%u)", devmap_handle, index);291 int ext2fs_node_get(fs_node_t **rfn, service_id_t service_id, fs_index_t index) 292 { 293 EXT2FS_DBG("(-,%" PRIun ",%u)", service_id, index); 296 294 297 295 ext2fs_instance_t *inst = NULL; 298 296 int rc; 299 297 300 rc = ext2fs_instance_get( devmap_handle, &inst);298 rc = ext2fs_instance_get(service_id, &inst); 301 299 if (rc != EOK) { 302 300 return rc; … … 319 317 /* Check if the node is not already open */ 320 318 unsigned long key[] = { 321 [OPEN_NODES_DEV_HANDLE_KEY] = inst-> devmap_handle,319 [OPEN_NODES_DEV_HANDLE_KEY] = inst->service_id, 322 320 [OPEN_NODES_INODE_KEY] = index, 323 321 }; … … 413 411 414 412 unsigned long key[] = { 415 [OPEN_NODES_DEV_HANDLE_KEY] = enode->instance-> devmap_handle,413 [OPEN_NODES_DEV_HANDLE_KEY] = enode->instance->service_id, 416 414 [OPEN_NODES_INODE_KEY] = enode->inode_ref->index, 417 415 }; … … 431 429 } 432 430 433 int ext2fs_create_node(fs_node_t **rfn, devmap_handle_t devmap_handle, int flags)431 int ext2fs_create_node(fs_node_t **rfn, service_id_t service_id, int flags) 434 432 { 435 433 EXT2FS_DBG(""); … … 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); … … 540 538 } 541 539 542 char ext2fs_plb_get_char(unsigned pos)543 {544 return ext2fs_reg.plb_ro[pos % PLB_SIZE];545 }546 547 540 bool ext2fs_is_directory(fs_node_t *fn) 548 541 { … … 564 557 } 565 558 566 devmap_handle_t ext2fs_device_get(fs_node_t *fn)559 service_id_t ext2fs_service_get(fs_node_t *fn) 567 560 { 568 561 EXT2FS_DBG(""); 569 562 ext2fs_node_t *enode = EXT2FS_NODE(fn); 570 return enode->instance-> devmap_handle;563 return enode->instance->service_id; 571 564 } 572 565 … … 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, 591 . device_get = ext2fs_device_get583 .service_get = ext2fs_service_get 592 584 }; 593 585 … … 596 588 */ 597 589 598 void ext2fs_mounted(ipc_callid_t rid, ipc_call_t *request) 599 { 600 EXT2FS_DBG(""); 601 int rc;602 devmap_handle_t devmap_handle = (devmap_handle_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 633 611 /* Initialize the filesystem */ 634 rc = ext2_filesystem_init(fs, devmap_handle);612 rc = ext2_filesystem_init(fs, service_id); 635 613 if (rc != EOK) { 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 662 637 /* Initialize instance */ 663 638 link_initialize(&inst->link); 664 inst-> devmap_handle = devmap_handle;639 inst->service_id = service_id; 665 640 inst->filesystem = fs; 666 641 inst->open_nodes_count = 0; … … 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 devmap_handle_t devmap_handle = (devmap_handle_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; 705 673 706 rc = ext2fs_instance_get(devmap_handle, &inst); 707 708 if (rc != EOK) { 709 async_answer_0(rid, rc); 710 return; 711 } 674 rc = ext2fs_instance_get(service_id, &inst); 675 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 devmap_handle_t devmap_handle = (devmap_handle_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; 767 } 768 769 rc = ext2fs_instance_get(devmap_handle, &inst); 716 return EINVAL; 717 } 718 719 rc = ext2fs_instance_get(service_id, &inst); 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 966 908 /* Usual case - we need to read a block from device */ 967 rc = block_get(&block, inst-> devmap_handle, fs_block, BLOCK_FLAGS_NONE);909 rc = block_get(&block, inst->service_id, fs_block, BLOCK_FLAGS_NONE); 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 // devmap_handle_t devmap_handle = (devmap_handle_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 // devmap_handle_t devmap_handle = (devmap_handle_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 // devmap_handle_t devmap_handle = (devmap_handle_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 // devmap_handle_t devmap_handle = (devmap_handle_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
Note:
See TracChangeset
for help on using the changeset viewer.