Changeset bd5f3b7 in mainline for uspace/srv/fs/ext2fs/ext2fs_ops.c


Ignore:
Timestamp:
2011-08-21T13:07:35Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
00aece0, f1a9e87
Parents:
86a34d3e (diff), a6480d5 (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.
Message:

Merge mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/ext2fs/ext2fs_ops.c

    r86a34d3e rbd5f3b7  
    11/*
    2  * Copyright (c) 2008 Jakub Jermar
    32 * Copyright (c) 2011 Martin Sucha
    43 * All rights reserved.
     
    4342#include <libext2.h>
    4443#include <ipc/services.h>
    45 #include <ipc/devmap.h>
     44#include <ipc/loc.h>
    4645#include <macros.h>
    4746#include <async.h>
     
    7069typedef struct ext2fs_instance {
    7170        link_t link;
    72         devmap_handle_t devmap_handle;
     71        service_id_t service_id;
    7372        ext2_filesystem_t *filesystem;
    7473        unsigned int open_nodes_count;
     
    8685 * Forward declarations of auxiliary functions
    8786 */
    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 *);
     87static int ext2fs_instance_get(service_id_t, ext2fs_instance_t **);
     88static int ext2fs_read_directory(ipc_callid_t, aoff64_t, size_t,
     89    ext2fs_instance_t *, ext2_inode_ref_t *, size_t *);
     90static int ext2fs_read_file(ipc_callid_t, aoff64_t, size_t, ext2fs_instance_t *,
     91    ext2_inode_ref_t *, size_t *);
    9392static bool ext2fs_is_dots(const uint8_t *, size_t);
    9493static int ext2fs_node_get_core(fs_node_t **, ext2fs_instance_t *, fs_index_t);
     
    9897 * Forward declarations of EXT2 libfs operations.
    9998 */
    100 static int ext2fs_root_get(fs_node_t **, devmap_handle_t);
     99static int ext2fs_root_get(fs_node_t **, service_id_t);
    101100static 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);
     101static int ext2fs_node_get(fs_node_t **, service_id_t, fs_index_t);
    103102static int ext2fs_node_open(fs_node_t *);
    104103static int ext2fs_node_put(fs_node_t *);
    105 static int ext2fs_create_node(fs_node_t **, devmap_handle_t, int);
     104static int ext2fs_create_node(fs_node_t **, service_id_t, int);
    106105static int ext2fs_destroy_node(fs_node_t *);
    107106static int ext2fs_link(fs_node_t *, fs_node_t *, const char *);
     
    111110static aoff64_t ext2fs_size_get(fs_node_t *);
    112111static unsigned ext2fs_lnkcnt_get(fs_node_t *);
    113 static char ext2fs_plb_get_char(unsigned);
    114112static bool ext2fs_is_directory(fs_node_t *);
    115113static bool ext2fs_is_file(fs_node_t *node);
    116 static devmap_handle_t ext2fs_device_get(fs_node_t *node);
     114static service_id_t ext2fs_device_get(fs_node_t *node);
    117115
    118116/*
     
    136134        ext2fs_node_t *enode = hash_table_get_instance(item, ext2fs_node_t, link);
    137135        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])) {
    140138                return false;
    141139        }
     
    182180
    183181/**
    184  * Find an instance of filesystem for the given devmap_handle
    185  */
    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 */
     184int ext2fs_instance_get(service_id_t service_id, ext2fs_instance_t **inst)
     185{
     186        EXT2FS_DBG("(%" PRIun ", -)", service_id);
    189187        ext2fs_instance_t *tmp;
    190188       
     
    200198                tmp = list_get_instance(link, ext2fs_instance_t, link);
    201199               
    202                 if (tmp->devmap_handle == devmap_handle) {
     200                if (tmp->service_id == service_id) {
    203201                        *inst = tmp;
    204202                        fibril_mutex_unlock(&instance_list_mutex);
     
    215213
    216214
    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);
     215int 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);
    221219}
    222220
     
    291289
    292290/** 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);
     291int 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);
    296294       
    297295        ext2fs_instance_t *inst = NULL;
    298296        int rc;
    299297       
    300         rc = ext2fs_instance_get(devmap_handle, &inst);
     298        rc = ext2fs_instance_get(service_id, &inst);
    301299        if (rc != EOK) {
    302300                return rc;
     
    319317        /* Check if the node is not already open */
    320318        unsigned long key[] = {
    321                 [OPEN_NODES_DEV_HANDLE_KEY] = inst->devmap_handle,
     319                [OPEN_NODES_DEV_HANDLE_KEY] = inst->service_id,
    322320                [OPEN_NODES_INODE_KEY] = index,
    323321        };
     
    413411
    414412        unsigned long key[] = {
    415                 [OPEN_NODES_DEV_HANDLE_KEY] = enode->instance->devmap_handle,
     413                [OPEN_NODES_DEV_HANDLE_KEY] = enode->instance->service_id,
    416414                [OPEN_NODES_INODE_KEY] = enode->inode_ref->index,
    417415        };
     
    431429}
    432430
    433 int ext2fs_create_node(fs_node_t **rfn, devmap_handle_t devmap_handle, int flags)
     431int ext2fs_create_node(fs_node_t **rfn, service_id_t service_id, int flags)
    434432{
    435433        EXT2FS_DBG("");
     
    540538}
    541539
    542 char ext2fs_plb_get_char(unsigned pos)
    543 {
    544         return ext2fs_reg.plb_ro[pos % PLB_SIZE];
    545 }
    546 
    547540bool ext2fs_is_directory(fs_node_t *fn)
    548541{
     
    564557}
    565558
    566 devmap_handle_t ext2fs_device_get(fs_node_t *fn)
     559service_id_t ext2fs_device_get(fs_node_t *fn)
    567560{
    568561        EXT2FS_DBG("");
    569562        ext2fs_node_t *enode = EXT2FS_NODE(fn);
    570         return enode->instance->devmap_handle;
     563        return enode->instance->service_id;
    571564}
    572565
     
    586579        .size_get = ext2fs_size_get,
    587580        .lnkcnt_get = ext2fs_lnkcnt_get,
    588         .plb_get_char = ext2fs_plb_get_char,
    589581        .is_directory = ext2fs_is_directory,
    590582        .is_file = ext2fs_is_file,
     
    596588 */
    597589
    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);
     590static 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;
    603595        ext2_filesystem_t *fs;
    604596        ext2fs_instance_t *inst;
    605597        bool read_only;
    606598       
    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        
    618599        /* Allocate libext2 filesystem structure */
    619600        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;
    624603       
    625604        /* Allocate instance structure */
     
    627606        if (inst == NULL) {
    628607                free(fs);
    629                 async_answer_0(rid, ENOMEM);
    630                 return;
     608                return ENOMEM;
    631609        }
    632610       
    633611        /* Initialize the filesystem  */
    634         rc = ext2_filesystem_init(fs, devmap_handle);
     612        rc = ext2_filesystem_init(fs, service_id);
    635613        if (rc != EOK) {
    636614                free(fs);
    637615                free(inst);
    638                 async_answer_0(rid, rc);
    639                 return;
     616                return rc;
    640617        }
    641618       
     
    646623                free(fs);
    647624                free(inst);
    648                 async_answer_0(rid, rc);
    649                 return;
     625                return rc;
    650626        }
    651627       
     
    656632                free(fs);
    657633                free(inst);
    658                 async_answer_0(rid, rc);
    659                 return;
     634                return rc;
    660635        }
    661636       
    662637        /* Initialize instance */
    663638        link_initialize(&inst->link);
    664         inst->devmap_handle = devmap_handle;
     639        inst->service_id = service_id;
    665640        inst->filesystem = fs;
    666641        inst->open_nodes_count = 0;
     
    673648                free(fs);
    674649                free(inst);
    675                 async_answer_0(rid, rc);
    676                 return;
     650                return rc;
    677651        }
    678652        ext2fs_node_t *enode = EXT2FS_NODE(root_node);
     
    683657        fibril_mutex_unlock(&instance_list_mutex);
    684658       
    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);
    689662       
    690663        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
     668static int ext2fs_unmounted(service_id_t service_id)
     669{
     670        EXT2FS_DBG("");
    703671        ext2fs_instance_t *inst;
    704672        int rc;
    705673       
    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;
    712678       
    713679        fibril_mutex_lock(&open_nodes_lock);
     
    716682        if (inst->open_nodes_count != 0) {
    717683                fibril_mutex_unlock(&open_nodes_lock);
    718                 async_answer_0(rid, EBUSY);
    719                 return;
     684                return EBUSY;
    720685        }
    721686       
     
    729694        ext2_filesystem_fini(inst->filesystem);
    730695       
    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
     699static int
     700ext2fs_read(service_id_t service_id, fs_index_t index, aoff64_t pos,
     701    size_t *rbytes)
     702{
     703        EXT2FS_DBG("");
    753704       
    754705        ext2fs_instance_t *inst;
     
    763714        if (!async_data_read_receive(&callid, &size)) {
    764715                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);
    770720        if (rc != EOK) {
    771721                async_answer_0(callid, rc);
    772                 async_answer_0(rid, rc);
    773                 return;
     722                return rc;
    774723        }
    775724       
     
    777726        if (rc != EOK) {
    778727                async_answer_0(callid, rc);
    779                 async_answer_0(rid, rc);
    780                 return;
     728                return rc;
    781729        }
    782730       
    783731        if (ext2_inode_is_type(inst->filesystem->superblock, inode_ref->inode,
    784                     EXT2_INODE_MODE_FILE)) {
    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                     EXT2_INODE_MODE_DIRECTORY)) {
    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 {
    792740                /* Other inode types not supported */
    793741                async_answer_0(callid, ENOTSUP);
    794                 async_answer_0(rid, ENOTSUP);
     742                rc = ENOTSUP;
    795743        }
    796744       
    797745        ext2_filesystem_put_inode_ref(inode_ref);
    798746       
     747        return rc;
    799748}
    800749
     
    814763}
    815764
    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)
     765int 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)
    818767{
    819768        ext2_directory_iterator_t it;
     
    827776        if (rc != EOK) {
    828777                async_answer_0(callid, rc);
    829                 async_answer_0(rid, rc);
    830                 return;
     778                return rc;
    831779        }
    832780       
     
    841789               
    842790                name_size = ext2_directory_entry_ll_get_name_length(
    843                         inst->filesystem->superblock, it.current);
     791                    inst->filesystem->superblock, it.current);
    844792               
    845793                /* skip . and .. */
     
    849797               
    850798                /* The on-disk entry does not contain \0 at the end
    851                         * end of entry name, so we copy it to new buffer
    852                         * and add the \0 at the end
    853                         */
     799                 * end of entry name, so we copy it to new buffer
     800                 * and add the \0 at the end
     801                 */
    854802                buf = malloc(name_size+1);
    855803                if (buf == NULL) {
    856804                        ext2_directory_iterator_fini(&it);
    857805                        async_answer_0(callid, ENOMEM);
    858                         async_answer_0(rid, ENOMEM);
    859                         return;
     806                        return ENOMEM;
    860807                }
    861808                memcpy(buf, &it.current->name, name_size);
    862                 *(buf+name_size) = 0;
     809                *(buf + name_size) = 0;
    863810                found = true;
    864                 (void) async_data_read_finalize(callid, buf, name_size+1);
     811                (void) async_data_read_finalize(callid, buf, name_size + 1);
    865812                free(buf);
    866813                break;
     
    871818                        ext2_directory_iterator_fini(&it);
    872819                        async_answer_0(callid, rc);
    873                         async_answer_0(rid, rc);
    874                         return;
     820                        return rc;
    875821                }
    876822        }
     
    878824        if (found) {
    879825                rc = ext2_directory_iterator_next(&it);
    880                 if (rc != EOK) {
    881                         async_answer_0(rid, rc);
    882                         return;
    883                 }
     826                if (rc != EOK)
     827                        return rc;
    884828                next = it.current_offset;
    885829        }
    886830       
    887831        rc = ext2_directory_iterator_fini(&it);
    888         if (rc != EOK) {
    889                 async_answer_0(rid, rc);
    890                 return;
    891         }
     832        if (rc != EOK)
     833                return rc;
    892834       
    893835        if (found) {
    894                 async_answer_1(rid, EOK, next-pos);
    895         }
    896         else {
     836                *rbytes = next - pos;
     837                return EOK;
     838        } else {
    897839                async_answer_0(callid, ENOENT);
    898                 async_answer_0(rid, ENOENT);
    899         }
    900 }
    901 
    902 void ext2fs_read_file(ipc_callid_t rid, ipc_callid_t callid, aoff64_t pos,
    903         size_t size, ext2fs_instance_t *inst, ext2_inode_ref_t *inode_ref)
     840                return ENOENT;
     841        }
     842}
     843
     844int 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)
    904846{
    905847        int rc;
     
    919861                /* Read 0 bytes successfully */
    920862                async_data_read_finalize(callid, NULL, 0);
    921                 async_answer_1(rid, EOK, 0);
    922                 return;
     863                *rbytes = 0;
     864                return EOK;
    923865        }
    924866       
     
    939881        if (rc != EOK) {
    940882                async_answer_0(callid, rc);
    941                 async_answer_0(rid, rc);
    942                 return;
     883                return rc;
    943884        }
    944885       
     
    952893                if (buffer == NULL) {
    953894                        async_answer_0(callid, ENOMEM);
    954                         async_answer_0(rid, ENOMEM);
    955                         return;
     895                        return ENOMEM;
    956896                }
    957897               
     
    959899               
    960900                async_data_read_finalize(callid, buffer, bytes);
    961                 async_answer_1(rid, EOK, bytes);
     901                *rbytes = bytes;
    962902               
    963903                free(buffer);
    964904               
    965                 return;
     905                return EOK;
    966906        }
    967907       
    968908        /* Usual case - we need to read a block from device */
    969         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);
    970910        if (rc != EOK) {
    971911                async_answer_0(callid, rc);
    972                 async_answer_0(rid, rc);
    973                 return;
     912                return rc;
    974913        }
    975914       
     
    978917       
    979918        rc = block_put(block);
    980         if (rc != EOK) {
    981                 async_answer_0(rid, rc);
    982                 return;
    983         }
    984                
    985         async_answer_1(rid, EOK, bytes);
    986 }
    987 
    988 void ext2fs_write(ipc_callid_t rid, ipc_call_t *request)
    989 {
    990         EXT2FS_DBG("");
    991 //      devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
    992 //      fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
    993 //      aoff64_t pos =
    994 //          (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*request), IPC_GET_ARG4(*request));
    995        
    996         // TODO
    997         async_answer_0(rid, ENOTSUP);
    998 }
    999 
    1000 void ext2fs_truncate(ipc_callid_t rid, ipc_call_t *request)
    1001 {
    1002         EXT2FS_DBG("");
    1003 //      devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
    1004 //      fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
    1005 //      aoff64_t size =
    1006 //          (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*request), IPC_GET_ARG4(*request));
    1007        
    1008         // TODO
    1009         async_answer_0(rid, ENOTSUP);
    1010 }
    1011 
    1012 void ext2fs_close(ipc_callid_t rid, ipc_call_t *request)
    1013 {
    1014         EXT2FS_DBG("");
    1015         async_answer_0(rid, EOK);
    1016 }
    1017 
    1018 void ext2fs_destroy(ipc_callid_t rid, ipc_call_t *request)
    1019 {
    1020         EXT2FS_DBG("");
    1021 //      devmap_handle_t devmap_handle = (devmap_handle_t)IPC_GET_ARG1(*request);
    1022 //      fs_index_t index = (fs_index_t)IPC_GET_ARG2(*request);
    1023        
    1024         // TODO
    1025         async_answer_0(rid, ENOTSUP);
    1026 }
    1027 
    1028 void ext2fs_open_node(ipc_callid_t rid, ipc_call_t *request)
    1029 {
    1030         EXT2FS_DBG("");
    1031         libfs_open_node(&ext2fs_libfs_ops, ext2fs_reg.fs_handle, rid, request);
    1032 }
    1033 
    1034 void ext2fs_stat(ipc_callid_t rid, ipc_call_t *request)
    1035 {
    1036         EXT2FS_DBG("");
    1037         libfs_stat(&ext2fs_libfs_ops, ext2fs_reg.fs_handle, rid, request);
    1038 }
    1039 
    1040 void ext2fs_sync(ipc_callid_t rid, ipc_call_t *request)
    1041 {
    1042         EXT2FS_DBG("");
    1043 //      devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
    1044 //      fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
    1045        
    1046         // TODO
    1047         async_answer_0(rid, ENOTSUP);
    1048 }
     919        if (rc != EOK)
     920                return rc;
     921       
     922        *rbytes = bytes;
     923        return EOK;
     924}
     925
     926static int
     927ext2fs_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
     934static int
     935ext2fs_truncate(service_id_t service_id, fs_index_t index, aoff64_t size)
     936{
     937        EXT2FS_DBG("");
     938        return ENOTSUP;
     939}
     940
     941static int ext2fs_close(service_id_t service_id, fs_index_t index)
     942{
     943        EXT2FS_DBG("");
     944        return EOK;
     945}
     946
     947static int ext2fs_destroy(service_id_t service_id, fs_index_t index)
     948{
     949        EXT2FS_DBG("");
     950        return ENOTSUP;
     951}
     952
     953static int ext2fs_sync(service_id_t service_id, fs_index_t index)
     954{
     955        EXT2FS_DBG("");
     956        return ENOTSUP;
     957}
     958
     959vfs_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};
    1049969
    1050970/**
    1051971 * @}
    1052972 */
     973
Note: See TracChangeset for help on using the changeset viewer.