Changeset b7fd2a0 in mainline for uspace/srv/vfs


Ignore:
Timestamp:
2018-01-13T03:10:29Z (8 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a53ed3a
Parents:
36f0738
Message:

Use errno_t in all uspace and kernel code.

Change type of every variable, parameter and return value that holds an
<errno.h> constant to either errno_t (the usual case), or sys_errno_t
(some places in kernel). This is for the purpose of self-documentation,
as well as for type-checking with a bit of type definition hackery.

Although this is a massive commit, it is a simple text replacement, and thus
is very easy to verify. Simply do the following:

`
git checkout <this commit's hash>
git reset HEAD
git add .
tools/srepl '\berrno_t\b' int
git add .
tools/srepl '\bsys_errno_t\b' sysarg_t
git reset
git diff
`

While this doesn't ensure that the replacements are correct, it does ensure
that the commit doesn't do anything except those replacements. Since errno_t
is typedef'd to int in the usual case (and sys_errno_t to sysarg_t), even if
incorrect, this commit cannot change behavior.

Location:
uspace/srv/vfs
Files:
9 edited

Legend:

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

    r36f0738 rb7fd2a0  
    8888int main(int argc, char **argv)
    8989{
    90         int rc;
     90        errno_t rc;
    9191
    9292        printf("%s: HelenOS VFS server\n", NAME);
  • uspace/srv/vfs/vfs.h

    r36f0738 rb7fd2a0  
    176176extern fs_handle_t fs_name_to_handle(unsigned int instance, const char *, bool);
    177177extern vfs_info_t *fs_handle_to_info(fs_handle_t);
    178 extern int vfs_get_fstypes(vfs_fstypes_t *);
    179 
    180 extern int vfs_lookup_internal(vfs_node_t *, char *, int, vfs_lookup_res_t *);
    181 extern int vfs_link_internal(vfs_node_t *, char *, vfs_triplet_t *);
     178extern errno_t vfs_get_fstypes(vfs_fstypes_t *);
     179
     180extern errno_t vfs_lookup_internal(vfs_node_t *, char *, int, vfs_lookup_res_t *);
     181extern errno_t vfs_link_internal(vfs_node_t *, char *, vfs_triplet_t *);
    182182
    183183extern bool vfs_nodes_init(void);
     
    194194
    195195extern void vfs_op_pass_handle(task_id_t, task_id_t, int);
    196 extern int vfs_wait_handle_internal(bool, int *);
     196extern errno_t vfs_wait_handle_internal(bool, int *);
    197197
    198198extern vfs_file_t *vfs_file_get(int);
    199199extern void vfs_file_put(vfs_file_t *);
    200 extern int vfs_fd_assign(vfs_file_t *, int);
    201 extern int vfs_fd_alloc(vfs_file_t **file, bool desc, int *);
    202 extern int vfs_fd_free(int);
     200extern errno_t vfs_fd_assign(vfs_file_t *, int);
     201extern errno_t vfs_fd_alloc(vfs_file_t **file, bool desc, int *);
     202extern errno_t vfs_fd_free(int);
    203203
    204204extern void vfs_node_addref(vfs_node_t *);
    205205extern void vfs_node_delref(vfs_node_t *);
    206 extern int vfs_open_node_remote(vfs_node_t *);
    207 
    208 extern int vfs_op_clone(int oldfd, int newfd, bool desc, int *);
    209 extern int vfs_op_fsprobe(const char *, service_id_t, vfs_fs_probe_info_t *);
    210 extern int vfs_op_mount(int mpfd, unsigned servid, unsigned flags, unsigned instance, const char *opts, const char *fsname, int *outfd);
    211 extern int vfs_op_mtab_get(void);
    212 extern int vfs_op_open(int fd, int flags);
    213 extern int vfs_op_put(int fd);
    214 extern int vfs_op_read(int fd, aoff64_t, size_t *out_bytes);
    215 extern int vfs_op_rename(int basefd, char *old, char *new);
    216 extern int vfs_op_resize(int fd, int64_t size);
    217 extern int vfs_op_stat(int fd);
    218 extern int vfs_op_statfs(int fd);
    219 extern int vfs_op_sync(int fd);
    220 extern int vfs_op_unlink(int parentfd, int expectfd, char *path);
    221 extern int vfs_op_unmount(int mpfd);
    222 extern int vfs_op_wait_handle(bool high_fd, int *out_fd);
    223 extern int vfs_op_walk(int parentfd, int flags, char *path, int *out_fd);
    224 extern int vfs_op_write(int fd, aoff64_t, size_t *out_bytes);
     206extern errno_t vfs_open_node_remote(vfs_node_t *);
     207
     208extern errno_t vfs_op_clone(int oldfd, int newfd, bool desc, int *);
     209extern errno_t vfs_op_fsprobe(const char *, service_id_t, vfs_fs_probe_info_t *);
     210extern errno_t vfs_op_mount(int mpfd, unsigned servid, unsigned flags, unsigned instance, const char *opts, const char *fsname, int *outfd);
     211extern errno_t vfs_op_mtab_get(void);
     212extern errno_t vfs_op_open(int fd, int flags);
     213extern errno_t vfs_op_put(int fd);
     214extern errno_t vfs_op_read(int fd, aoff64_t, size_t *out_bytes);
     215extern errno_t vfs_op_rename(int basefd, char *old, char *new);
     216extern errno_t vfs_op_resize(int fd, int64_t size);
     217extern errno_t vfs_op_stat(int fd);
     218extern errno_t vfs_op_statfs(int fd);
     219extern errno_t vfs_op_sync(int fd);
     220extern errno_t vfs_op_unlink(int parentfd, int expectfd, char *path);
     221extern errno_t vfs_op_unmount(int mpfd);
     222extern errno_t vfs_op_wait_handle(bool high_fd, int *out_fd);
     223extern errno_t vfs_op_walk(int parentfd, int flags, char *path, int *out_fd);
     224extern errno_t vfs_op_write(int fd, aoff64_t, size_t *out_bytes);
    225225
    226226extern void vfs_register(ipc_callid_t, ipc_call_t *);
     
    233233} rdwr_io_chunk_t;
    234234
    235 extern int vfs_rdwr_internal(int, aoff64_t, bool, rdwr_io_chunk_t *);
     235extern errno_t vfs_rdwr_internal(int, aoff64_t, bool, rdwr_io_chunk_t *);
    236236
    237237extern void vfs_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg);
  • uspace/srv/vfs/vfs_file.c

    r36f0738 rb7fd2a0  
    6464} vfs_boxed_handle_t;
    6565
    66 static int _vfs_fd_free(vfs_client_data_t *, int);
     66static errno_t _vfs_fd_free(vfs_client_data_t *, int);
    6767
    6868/** Initialize the table of open files. */
     
    133133
    134134/** Close the file in the endpoint FS server. */
    135 static int vfs_file_close_remote(vfs_file_t *file)
     135static errno_t vfs_file_close_remote(vfs_file_t *file)
    136136{
    137137        assert(!file->refcnt);
     
    145145        vfs_exchange_release(exch);
    146146       
    147         int rc;
     147        errno_t rc;
    148148        async_wait_for(msg, &rc);
    149149       
     
    168168 *                      decremented.
    169169 */
    170 static int vfs_file_delref(vfs_client_data_t *vfs_data, vfs_file_t *file)
    171 {
    172         int rc = EOK;
     170static errno_t vfs_file_delref(vfs_client_data_t *vfs_data, vfs_file_t *file)
     171{
     172        errno_t rc = EOK;
    173173
    174174        assert(fibril_mutex_is_locked(&vfs_data->lock));
     
    192192}
    193193
    194 static int _vfs_fd_alloc(vfs_client_data_t *vfs_data, vfs_file_t **file, bool desc, int *out_fd)
     194static errno_t _vfs_fd_alloc(vfs_client_data_t *vfs_data, vfs_file_t **file, bool desc, int *out_fd)
    195195{
    196196        if (!vfs_files_init(vfs_data))
     
    254254 * @return Error code.
    255255 */
    256 int vfs_fd_alloc(vfs_file_t **file, bool desc, int *out_fd)
     256errno_t vfs_fd_alloc(vfs_file_t **file, bool desc, int *out_fd)
    257257{
    258258        return _vfs_fd_alloc(VFS_DATA, file, desc, out_fd);
    259259}
    260260
    261 static int _vfs_fd_free_locked(vfs_client_data_t *vfs_data, int fd)
     261static errno_t _vfs_fd_free_locked(vfs_client_data_t *vfs_data, int fd)
    262262{
    263263        if ((fd < 0) || (fd >= MAX_OPEN_FILES) || !vfs_data->files[fd]) {
     
    265265        }
    266266
    267         int rc = vfs_file_delref(vfs_data, vfs_data->files[fd]);
     267        errno_t rc = vfs_file_delref(vfs_data, vfs_data->files[fd]);
    268268        vfs_data->files[fd] = NULL;
    269269        return rc;
    270270}
    271271
    272 static int _vfs_fd_free(vfs_client_data_t *vfs_data, int fd)
    273 {
    274         int rc;
     272static errno_t _vfs_fd_free(vfs_client_data_t *vfs_data, int fd)
     273{
     274        errno_t rc;
    275275
    276276        if (!vfs_files_init(vfs_data))
     
    291291 *                      descriptor.
    292292 */
    293 int vfs_fd_free(int fd)
     293errno_t vfs_fd_free(int fd)
    294294{
    295295        return _vfs_fd_free(VFS_DATA, fd);
     
    305305 *
    306306 */
    307 int vfs_fd_assign(vfs_file_t *file, int fd)
     307errno_t vfs_fd_assign(vfs_file_t *file, int fd)
    308308{
    309309        if (!vfs_files_init(VFS_DATA))
     
    429429}
    430430
    431 int vfs_wait_handle_internal(bool high_fd, int *out_fd)
     431errno_t vfs_wait_handle_internal(bool high_fd, int *out_fd)
    432432{
    433433        vfs_client_data_t *vfs_data = VFS_DATA;
     
    443443
    444444        vfs_file_t *file;
    445         int rc = _vfs_fd_alloc(vfs_data, &file, high_fd, out_fd);
     445        errno_t rc = _vfs_fd_alloc(vfs_data, &file, high_fd, out_fd);
    446446        if (rc != EOK) {
    447447                vfs_node_delref(bh->node);
  • uspace/srv/vfs/vfs_ipc.c

    r36f0738 rb7fd2a0  
    4242       
    4343        int outfd = -1;
    44         int rc = vfs_op_clone(oldfd, newfd, desc, &outfd);
     44        errno_t rc = vfs_op_clone(oldfd, newfd, desc, &outfd);
    4545        async_answer_1(rid, rc, outfd);
    4646}
     
    5353        vfs_fs_probe_info_t info;
    5454        size_t len;
    55         int rc;
     55        errno_t rc;
    5656       
    5757        /*
     
    8888        size_t len;
    8989        vfs_fstypes_t fstypes;
    90         int rc;
     90        errno_t rc;
    9191
    9292        rc = vfs_get_fstypes(&fstypes);
     
    129129       
    130130        /* Now we expect to receive the mount options. */
    131         int rc = async_data_write_accept((void **) &opts, true, 0,
     131        errno_t rc = async_data_write_accept((void **) &opts, true, 0,
    132132            MAX_MNTOPTS_LEN, 0, NULL);
    133133        if (rc != EOK) {
     
    161161        int mode = IPC_GET_ARG2(*request);
    162162
    163         int rc = vfs_op_open(fd, mode);
     163        errno_t rc = vfs_op_open(fd, mode);
    164164        async_answer_0(rid, rc);
    165165}
     
    168168{
    169169        int fd = IPC_GET_ARG1(*request);
    170         int rc = vfs_op_put(fd);
     170        errno_t rc = vfs_op_put(fd);
    171171        async_answer_0(rid, rc);
    172172}
     
    179179
    180180        size_t bytes = 0;
    181         int rc = vfs_op_read(fd, pos, &bytes);
     181        errno_t rc = vfs_op_read(fd, pos, &bytes);
    182182        async_answer_1(rid, rc, bytes);
    183183}
     
    189189        char *old = NULL;
    190190        char *new = NULL;
    191         int rc;
     191        errno_t rc;
    192192       
    193193        basefd = IPC_GET_ARG1(*request);
     
    231231        int fd = IPC_GET_ARG1(*request);
    232232        int64_t size = MERGE_LOUP32(IPC_GET_ARG2(*request), IPC_GET_ARG3(*request));
    233         int rc = vfs_op_resize(fd, size);
     233        errno_t rc = vfs_op_resize(fd, size);
    234234        async_answer_0(rid, rc);
    235235}
     
    238238{
    239239        int fd = IPC_GET_ARG1(*request);
    240         int rc = vfs_op_stat(fd);
     240        errno_t rc = vfs_op_stat(fd);
    241241        async_answer_0(rid, rc);
    242242}
     
    246246        int fd = (int) IPC_GET_ARG1(*request);
    247247       
    248         int rc = vfs_op_statfs(fd);
     248        errno_t rc = vfs_op_statfs(fd);
    249249        async_answer_0(rid, rc);
    250250}
     
    253253{
    254254        int fd = IPC_GET_ARG1(*request);
    255         int rc = vfs_op_sync(fd);
     255        errno_t rc = vfs_op_sync(fd);
    256256        async_answer_0(rid, rc);
    257257}
     
    263263       
    264264        char *path;
    265         int rc = async_data_write_accept((void **) &path, true, 0, 0, 0, NULL);
     265        errno_t rc = async_data_write_accept((void **) &path, true, 0, 0, 0, NULL);
    266266        if (rc == EOK)
    267267                rc = vfs_op_unlink(parentfd, expectfd, path);
     
    273273{
    274274        int mpfd = IPC_GET_ARG1(*request);
    275         int rc = vfs_op_unmount(mpfd);
     275        errno_t rc = vfs_op_unmount(mpfd);
    276276        async_answer_0(rid, rc);
    277277}
     
    281281        bool high_fd = IPC_GET_ARG1(*request);
    282282        int fd = -1;
    283         int rc = vfs_op_wait_handle(high_fd, &fd);
     283        errno_t rc = vfs_op_wait_handle(high_fd, &fd);
    284284        async_answer_1(rid, rc, fd);
    285285}
     
    296296        int fd = 0;
    297297        char *path;
    298         int rc = async_data_write_accept((void **)&path, true, 0, 0, 0, NULL);
     298        errno_t rc = async_data_write_accept((void **)&path, true, 0, 0, 0, NULL);
    299299        if (rc == EOK) {
    300300                rc = vfs_op_walk(parentfd, flags, path, &fd);
     
    311311
    312312        size_t bytes = 0;
    313         int rc = vfs_op_write(fd, pos, &bytes);
     313        errno_t rc = vfs_op_write(fd, pos, &bytes);
    314314        async_answer_1(rid, rc, bytes);
    315315}
  • uspace/srv/vfs/vfs_lookup.c

    r36f0738 rb7fd2a0  
    5353uint8_t *plb = NULL;
    5454
    55 static int plb_insert_entry(plb_entry_t *entry, char *path, size_t *start,
     55static errno_t plb_insert_entry(plb_entry_t *entry, char *path, size_t *start,
    5656    size_t len)
    5757{
     
    138138}
    139139
    140 int vfs_link_internal(vfs_node_t *base, char *path, vfs_triplet_t *child)
     140errno_t vfs_link_internal(vfs_node_t *base, char *path, vfs_triplet_t *child)
    141141{
    142142        assert(base != NULL);
     
    148148        vfs_lookup_res_t res;
    149149        char component[NAME_MAX + 1];
    150         int rc;
     150        errno_t rc;
    151151       
    152152        size_t len;
     
    197197       
    198198        rc = async_data_write_start(exch, component, str_size(component) + 1);
    199         int orig_rc;
     199        errno_t orig_rc;
    200200        async_wait_for(req, &orig_rc);
    201201        vfs_exchange_release(exch);
     
    207207}
    208208
    209 static int out_lookup(vfs_triplet_t *base, size_t *pfirst, size_t *plen,
     209static errno_t out_lookup(vfs_triplet_t *base, size_t *pfirst, size_t *plen,
    210210    int lflag, vfs_lookup_res_t *result)
    211211{
     
    213213        assert(result);
    214214       
    215         int rc;
     215        errno_t rc;
    216216        ipc_call_t answer;
    217217        async_exch_t *exch = vfs_exchange_grab(base->fs_handle);
     
    238238}
    239239
    240 static int _vfs_lookup_internal(vfs_node_t *base, char *path, int lflag,
     240static errno_t _vfs_lookup_internal(vfs_node_t *base, char *path, int lflag,
    241241    vfs_lookup_res_t *result, size_t len)
    242242{
    243243        size_t first;
    244         int rc;
     244        errno_t rc;
    245245
    246246        plb_entry_t entry;
     
    334334 *
    335335 */
    336 int vfs_lookup_internal(vfs_node_t *base, char *path, int lflag,
     336errno_t vfs_lookup_internal(vfs_node_t *base, char *path, int lflag,
    337337    vfs_lookup_res_t *result)
    338338{
     
    341341       
    342342        size_t len;
    343         int rc;
     343        errno_t rc;
    344344        char *npath = canonify(path, &len);
    345345        if (!npath) {
  • uspace/srv/vfs/vfs_node.c

    r36f0738 rb7fd2a0  
    265265 *
    266266 */
    267 int vfs_open_node_remote(vfs_node_t *node)
     267errno_t vfs_open_node_remote(vfs_node_t *node)
    268268{
    269269        async_exch_t *exch = vfs_exchange_grab(node->fs_handle);
     
    275275        vfs_exchange_release(exch);
    276276
    277         int rc;
     277        errno_t rc;
    278278        async_wait_for(req, &rc);
    279279       
     
    318318{
    319319        async_exch_t *exch = vfs_exchange_grab(node->fs_handle);
    320         int rc = async_req_2_0(exch, VFS_OUT_IS_EMPTY, node->service_id,
     320        errno_t rc = async_req_2_0(exch, VFS_OUT_IS_EMPTY, node->service_id,
    321321            node->index);
    322322        vfs_exchange_release(exch);
  • uspace/srv/vfs/vfs_ops.c

    r36f0738 rb7fd2a0  
    5252
    5353/* Forward declarations of static functions. */
    54 static int vfs_truncate_internal(fs_handle_t, service_id_t, fs_index_t,
     54static errno_t vfs_truncate_internal(fs_handle_t, service_id_t, fs_index_t,
    5555    aoff64_t);
    5656
     
    8686}
    8787
    88 int vfs_op_clone(int oldfd, int newfd, bool desc, int *out_fd)
    89 {
    90         int rc;
     88errno_t vfs_op_clone(int oldfd, int newfd, bool desc, int *out_fd)
     89{
     90        errno_t rc;
    9191
    9292        /* If the file descriptors are the same, do nothing. */
     
    121121}
    122122
    123 int vfs_op_put(int fd)
     123errno_t vfs_op_put(int fd)
    124124{
    125125        return vfs_fd_free(fd);
    126126}
    127127
    128 static int vfs_connect_internal(service_id_t service_id, unsigned flags,
     128static errno_t 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         int rc = async_data_write_start(exch, options, str_size(options));
     154        errno_t rc = async_data_write_start(exch, options, str_size(options));
    155155        if (rc != EOK) {
    156156                async_forget(msg);
     
    188188}
    189189
    190 int vfs_op_fsprobe(const char *fs_name, service_id_t sid,
     190errno_t 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         int rc;
    195         int retval;
     194        errno_t rc;
     195        errno_t retval;
    196196       
    197197        fibril_mutex_lock(&fs_list_lock);
     
    222222}
    223223
    224 int vfs_op_mount(int mpfd, unsigned service_id, unsigned flags,
     224errno_t 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         int rc;
     227        errno_t rc;
    228228        vfs_file_t *mp = NULL;
    229229        vfs_file_t *file = NULL;
     
    302302}
    303303
    304 int vfs_op_open(int fd, int mode)
     304errno_t vfs_op_open(int fd, int mode)
    305305{
    306306        if (mode == 0)
     
    336336        }
    337337       
    338         int rc = vfs_open_node_remote(file->node);
     338        errno_t rc = vfs_open_node_remote(file->node);
    339339        if (rc != EOK) {
    340340                file->open_read = file->open_write = false;
     
    347347}
    348348
    349 typedef int (* rdwr_ipc_cb_t)(async_exch_t *, vfs_file_t *, aoff64_t,
     349typedef errno_t (* rdwr_ipc_cb_t)(async_exch_t *, vfs_file_t *, aoff64_t,
    350350    ipc_call_t *, bool, void *);
    351351
    352 static int rdwr_ipc_client(async_exch_t *exch, vfs_file_t *file, aoff64_t pos,
     352static errno_t 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         int rc;
     356        errno_t rc;
    357357
    358358        /*
     
    378378}
    379379
    380 static int rdwr_ipc_internal(async_exch_t *exch, vfs_file_t *file, aoff64_t pos,
     380static errno_t 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         int retval = async_data_read_start(exch, chunk->buffer, chunk->size);
     394        errno_t retval = async_data_read_start(exch, chunk->buffer, chunk->size);
    395395        if (retval != EOK) {
    396396                async_forget(msg);
     
    398398        }
    399399       
    400         int rc;
     400        errno_t rc;
    401401        async_wait_for(msg, &rc);
    402402       
    403403        chunk->size = IPC_GET_ARG1(*answer);
    404404
    405         return (int) rc;
    406 }
    407 
    408 static int vfs_rdwr(int fd, aoff64_t pos, bool read, rdwr_ipc_cb_t ipc_cb,
     405        return (errno_t) rc;
     406}
     407
     408static errno_t 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         int rc = ipc_cb(fs_exch, file, pos, &answer, read, ipc_cb_data);
     477        errno_t rc = ipc_cb(fs_exch, file, pos, &answer, read, ipc_cb_data);
    478478       
    479479        vfs_exchange_release(fs_exch);
     
    499499}
    500500
    501 int vfs_rdwr_internal(int fd, aoff64_t pos, bool read, rdwr_io_chunk_t *chunk)
     501errno_t 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 int vfs_op_read(int fd, aoff64_t pos, size_t *out_bytes)
     506errno_t 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 int vfs_op_rename(int basefd, char *old, char *new)
     511errno_t 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         int rc;
     526        errno_t rc;
    527527       
    528528        size_t shared = shared_path(old, new);
     
    610610}
    611611
    612 int vfs_op_resize(int fd, int64_t size)
     612errno_t 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         int rc = vfs_truncate_internal(file->node->fs_handle,
     620        errno_t rc = vfs_truncate_internal(file->node->fs_handle,
    621621            file->node->service_id, file->node->index, size);
    622622        if (rc == EOK)
     
    628628}
    629629
    630 int vfs_op_stat(int fd)
     630errno_t 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         int rc = async_data_read_forward_fast(exch, VFS_OUT_STAT,
     639        errno_t 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 int vfs_op_statfs(int fd)
     647errno_t 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         int rc = async_data_read_forward_fast(exch, VFS_OUT_STATFS,
     656        errno_t 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 int vfs_op_sync(int fd)
     664errno_t vfs_op_sync(int fd)
    665665{
    666666        vfs_file_t *file = vfs_file_get(fd);
     
    677677        vfs_exchange_release(fs_exch);
    678678       
    679         int rc;
     679        errno_t rc;
    680680        async_wait_for(msg, &rc);
    681681       
     
    685685}
    686686
    687 static int vfs_truncate_internal(fs_handle_t fs_handle, service_id_t service_id,
     687static errno_t 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         int rc = async_req_4_0(exch, VFS_OUT_TRUNCATE,
     691        errno_t 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 (int) rc;
    697 }
    698 
    699 int vfs_op_unlink(int parentfd, int expectfd, char *path)
    700 {
    701         int rc = EOK;
     696        return (errno_t) rc;
     697}
     698
     699errno_t vfs_op_unlink(int parentfd, int expectfd, char *path)
     700{
     701        errno_t rc = EOK;
    702702        vfs_file_t *parent = NULL;
    703703        vfs_file_t *expect = NULL;
     
    778778}
    779779
    780 int vfs_op_unmount(int mpfd)
     780errno_t 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         int rc = async_req_1_0(exch, VFS_OUT_UNMOUNTED,
     808        errno_t rc = async_req_1_0(exch, VFS_OUT_UNMOUNTED,
    809809            mp->node->mount->service_id);
    810810        vfs_exchange_release(exch);
     
    826826}
    827827
    828 int vfs_op_wait_handle(bool high_fd, int *out_fd)
     828errno_t vfs_op_wait_handle(bool high_fd, int *out_fd)
    829829{
    830830        return vfs_wait_handle_internal(high_fd, out_fd);
     
    862862}
    863863
    864 int vfs_op_walk(int parentfd, int flags, char *path, int *out_fd)
     864errno_t 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         int rc = vfs_lookup_internal(parent->node, path,
     876        errno_t rc = vfs_lookup_internal(parent->node, path,
    877877            walk_lookup_flags(flags), &lr);
    878878        if (rc != EOK) {
     
    911911}
    912912
    913 int vfs_op_write(int fd, aoff64_t pos, size_t *out_bytes)
     913errno_t 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);
  • uspace/srv/vfs/vfs_pager.c

    r36f0738 rb7fd2a0  
    4848        int fd = IPC_GET_ARG3(*request);
    4949        void *page;
    50         int rc;
     50        errno_t rc;
    5151
    5252        page = as_area_create(AS_AREA_ANY, page_size,
  • uspace/srv/vfs/vfs_register.c

    r36f0738 rb7fd2a0  
    118118       
    119119        vfs_info_t *vfs_info;
    120         int rc = async_data_write_accept((void **) &vfs_info, false,
     120        errno_t rc = async_data_write_accept((void **) &vfs_info, false,
    121121            sizeof(vfs_info_t), sizeof(vfs_info_t), 0, NULL);
    122122       
     
    348348 * @return EOK on success or an error code
    349349 */
    350 int vfs_get_fstypes(vfs_fstypes_t *fstypes)
     350errno_t vfs_get_fstypes(vfs_fstypes_t *fstypes)
    351351{
    352352        size_t size;
Note: See TracChangeset for help on using the changeset viewer.