Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/vfs/vfs_ops.c

    rb7fd2a0 r25a179e  
    5252
    5353/* Forward declarations of static functions. */
    54 static errno_t vfs_truncate_internal(fs_handle_t, service_id_t, fs_index_t,
     54static int vfs_truncate_internal(fs_handle_t, service_id_t, fs_index_t,
    5555    aoff64_t);
    5656
     
    8686}
    8787
    88 errno_t vfs_op_clone(int oldfd, int newfd, bool desc, int *out_fd)
    89 {
    90         errno_t rc;
     88int vfs_op_clone(int oldfd, int newfd, bool desc, int *out_fd)
     89{
     90        int rc;
    9191
    9292        /* If the file descriptors are the same, do nothing. */
     
    121121}
    122122
    123 errno_t vfs_op_put(int fd)
     123int vfs_op_put(int fd)
    124124{
    125125        return vfs_fd_free(fd);
    126126}
    127127
    128 static errno_t vfs_connect_internal(service_id_t service_id, unsigned flags,
     128static int vfs_connect_internal(service_id_t service_id, unsigned flags,
    129129    unsigned instance, const char *options, const char *fsname,
    130130    vfs_node_t **root)
     
    152152            &answer);
    153153        /* Send the mount options */
    154         errno_t rc = async_data_write_start(exch, options, str_size(options));
     154        int rc = async_data_write_start(exch, options, str_size(options));
    155155        if (rc != EOK) {
    156156                async_forget(msg);
     
    188188}
    189189
    190 errno_t vfs_op_fsprobe(const char *fs_name, service_id_t sid,
     190int vfs_op_fsprobe(const char *fs_name, service_id_t sid,
    191191    vfs_fs_probe_info_t *info)
    192192{
    193193        fs_handle_t fs_handle = 0;
    194         errno_t rc;
    195         errno_t retval;
     194        int rc;
     195        int retval;
    196196       
    197197        fibril_mutex_lock(&fs_list_lock);
     
    222222}
    223223
    224 errno_t vfs_op_mount(int mpfd, unsigned service_id, unsigned flags,
     224int vfs_op_mount(int mpfd, unsigned service_id, unsigned flags,
    225225    unsigned instance, const char *opts, const char *fs_name, int *out_fd)
    226226{
    227         errno_t rc;
     227        int rc;
    228228        vfs_file_t *mp = NULL;
    229229        vfs_file_t *file = NULL;
     
    302302}
    303303
    304 errno_t vfs_op_open(int fd, int mode)
     304int vfs_op_open(int fd, int mode)
    305305{
    306306        if (mode == 0)
     
    336336        }
    337337       
    338         errno_t rc = vfs_open_node_remote(file->node);
     338        int rc = vfs_open_node_remote(file->node);
    339339        if (rc != EOK) {
    340340                file->open_read = file->open_write = false;
     
    347347}
    348348
    349 typedef errno_t (* rdwr_ipc_cb_t)(async_exch_t *, vfs_file_t *, aoff64_t,
     349typedef int (* rdwr_ipc_cb_t)(async_exch_t *, vfs_file_t *, aoff64_t,
    350350    ipc_call_t *, bool, void *);
    351351
    352 static errno_t rdwr_ipc_client(async_exch_t *exch, vfs_file_t *file, aoff64_t pos,
     352static int rdwr_ipc_client(async_exch_t *exch, vfs_file_t *file, aoff64_t pos,
    353353    ipc_call_t *answer, bool read, void *data)
    354354{
    355355        size_t *bytes = (size_t *) data;
    356         errno_t rc;
     356        int rc;
    357357
    358358        /*
     
    378378}
    379379
    380 static errno_t rdwr_ipc_internal(async_exch_t *exch, vfs_file_t *file, aoff64_t pos,
     380static int rdwr_ipc_internal(async_exch_t *exch, vfs_file_t *file, aoff64_t pos,
    381381    ipc_call_t *answer, bool read, void *data)
    382382{
     
    392392                return EINVAL;
    393393
    394         errno_t retval = async_data_read_start(exch, chunk->buffer, chunk->size);
     394        int retval = async_data_read_start(exch, chunk->buffer, chunk->size);
    395395        if (retval != EOK) {
    396396                async_forget(msg);
     
    398398        }
    399399       
    400         errno_t rc;
     400        int rc;
    401401        async_wait_for(msg, &rc);
    402402       
    403403        chunk->size = IPC_GET_ARG1(*answer);
    404404
    405         return (errno_t) rc;
    406 }
    407 
    408 static errno_t vfs_rdwr(int fd, aoff64_t pos, bool read, rdwr_ipc_cb_t ipc_cb,
     405        return (int) rc;
     406}
     407
     408static int vfs_rdwr(int fd, aoff64_t pos, bool read, rdwr_ipc_cb_t ipc_cb,
    409409    void *ipc_cb_data)
    410410{
     
    475475         */
    476476        ipc_call_t answer;
    477         errno_t rc = ipc_cb(fs_exch, file, pos, &answer, read, ipc_cb_data);
     477        int rc = ipc_cb(fs_exch, file, pos, &answer, read, ipc_cb_data);
    478478       
    479479        vfs_exchange_release(fs_exch);
     
    499499}
    500500
    501 errno_t vfs_rdwr_internal(int fd, aoff64_t pos, bool read, rdwr_io_chunk_t *chunk)
     501int vfs_rdwr_internal(int fd, aoff64_t pos, bool read, rdwr_io_chunk_t *chunk)
    502502{
    503503        return vfs_rdwr(fd, pos, read, rdwr_ipc_internal, chunk);
    504504}
    505505
    506 errno_t vfs_op_read(int fd, aoff64_t pos, size_t *out_bytes)
     506int vfs_op_read(int fd, aoff64_t pos, size_t *out_bytes)
    507507{
    508508        return vfs_rdwr(fd, pos, true, rdwr_ipc_client, out_bytes);
    509509}
    510510
    511 errno_t vfs_op_rename(int basefd, char *old, char *new)
     511int vfs_op_rename(int basefd, char *old, char *new)
    512512{
    513513        vfs_file_t *base_file = vfs_file_get(basefd);
     
    524524        bool orig_unlinked = false;
    525525       
    526         errno_t rc;
     526        int rc;
    527527       
    528528        size_t shared = shared_path(old, new);
     
    610610}
    611611
    612 errno_t vfs_op_resize(int fd, int64_t size)
     612int vfs_op_resize(int fd, int64_t size)
    613613{
    614614        vfs_file_t *file = vfs_file_get(fd);
     
    618618        fibril_rwlock_write_lock(&file->node->contents_rwlock);
    619619       
    620         errno_t rc = vfs_truncate_internal(file->node->fs_handle,
     620        int rc = vfs_truncate_internal(file->node->fs_handle,
    621621            file->node->service_id, file->node->index, size);
    622622        if (rc == EOK)
     
    628628}
    629629
    630 errno_t vfs_op_stat(int fd)
     630int vfs_op_stat(int fd)
    631631{
    632632        vfs_file_t *file = vfs_file_get(fd);
     
    637637
    638638        async_exch_t *exch = vfs_exchange_grab(node->fs_handle);
    639         errno_t rc = async_data_read_forward_fast(exch, VFS_OUT_STAT,
     639        int rc = async_data_read_forward_fast(exch, VFS_OUT_STAT,
    640640            node->service_id, node->index, true, 0, NULL);
    641641        vfs_exchange_release(exch);
     
    645645}
    646646
    647 errno_t vfs_op_statfs(int fd)
     647int vfs_op_statfs(int fd)
    648648{
    649649        vfs_file_t *file = vfs_file_get(fd);
     
    654654
    655655        async_exch_t *exch = vfs_exchange_grab(node->fs_handle);
    656         errno_t rc = async_data_read_forward_fast(exch, VFS_OUT_STATFS,
     656        int rc = async_data_read_forward_fast(exch, VFS_OUT_STATFS,
    657657            node->service_id, node->index, false, 0, NULL);
    658658        vfs_exchange_release(exch);
     
    662662}
    663663
    664 errno_t vfs_op_sync(int fd)
     664int vfs_op_sync(int fd)
    665665{
    666666        vfs_file_t *file = vfs_file_get(fd);
     
    677677        vfs_exchange_release(fs_exch);
    678678       
    679         errno_t rc;
     679        int rc;
    680680        async_wait_for(msg, &rc);
    681681       
     
    685685}
    686686
    687 static errno_t vfs_truncate_internal(fs_handle_t fs_handle, service_id_t service_id,
     687static int vfs_truncate_internal(fs_handle_t fs_handle, service_id_t service_id,
    688688    fs_index_t index, aoff64_t size)
    689689{
    690690        async_exch_t *exch = vfs_exchange_grab(fs_handle);
    691         errno_t rc = async_req_4_0(exch, VFS_OUT_TRUNCATE,
     691        int rc = async_req_4_0(exch, VFS_OUT_TRUNCATE,
    692692            (sysarg_t) service_id, (sysarg_t) index, LOWER32(size),
    693693            UPPER32(size));
    694694        vfs_exchange_release(exch);
    695695       
    696         return (errno_t) rc;
    697 }
    698 
    699 errno_t vfs_op_unlink(int parentfd, int expectfd, char *path)
    700 {
    701         errno_t rc = EOK;
     696        return (int) rc;
     697}
     698
     699int vfs_op_unlink(int parentfd, int expectfd, char *path)
     700{
     701        int rc = EOK;
    702702        vfs_file_t *parent = NULL;
    703703        vfs_file_t *expect = NULL;
     
    778778}
    779779
    780 errno_t vfs_op_unmount(int mpfd)
     780int vfs_op_unmount(int mpfd)
    781781{
    782782        vfs_file_t *mp = vfs_file_get(mpfd);
     
    806806       
    807807        async_exch_t *exch = vfs_exchange_grab(mp->node->mount->fs_handle);
    808         errno_t rc = async_req_1_0(exch, VFS_OUT_UNMOUNTED,
     808        int rc = async_req_1_0(exch, VFS_OUT_UNMOUNTED,
    809809            mp->node->mount->service_id);
    810810        vfs_exchange_release(exch);
     
    826826}
    827827
    828 errno_t vfs_op_wait_handle(bool high_fd, int *out_fd)
     828int vfs_op_wait_handle(bool high_fd, int *out_fd)
    829829{
    830830        return vfs_wait_handle_internal(high_fd, out_fd);
     
    862862}
    863863
    864 errno_t vfs_op_walk(int parentfd, int flags, char *path, int *out_fd)
     864int vfs_op_walk(int parentfd, int flags, char *path, int *out_fd)
    865865{
    866866        if (!walk_flags_valid(flags))
     
    874874       
    875875        vfs_lookup_res_t lr;
    876         errno_t rc = vfs_lookup_internal(parent->node, path,
     876        int rc = vfs_lookup_internal(parent->node, path,
    877877            walk_lookup_flags(flags), &lr);
    878878        if (rc != EOK) {
     
    911911}
    912912
    913 errno_t vfs_op_write(int fd, aoff64_t pos, size_t *out_bytes)
     913int vfs_op_write(int fd, aoff64_t pos, size_t *out_bytes)
    914914{
    915915        return vfs_rdwr(fd, pos, false, rdwr_ipc_client, out_bytes);
Note: See TracChangeset for help on using the changeset viewer.