Changeset b7fd2a0 in mainline for uspace/srv/volsrv/empty.c


Ignore:
Timestamp:
2018-01-13T03:10:29Z (7 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/volsrv/empty.c

    r36f0738 rb7fd2a0  
    4444#include "empty.h"
    4545
    46 static int empty_get_bsize(void *, size_t *);
    47 static int empty_get_nblocks(void *, aoff64_t *);
    48 static int empty_read(void *, aoff64_t, size_t, void *);
    49 static int empty_write(void *, aoff64_t, size_t, const void *);
     46static errno_t empty_get_bsize(void *, size_t *);
     47static errno_t empty_get_nblocks(void *, aoff64_t *);
     48static errno_t empty_read(void *, aoff64_t, size_t, void *);
     49static errno_t empty_write(void *, aoff64_t, size_t, const void *);
    5050
    5151/** Provide disk access to liblabel */
     
    5757};
    5858
    59 int volsrv_part_is_empty(service_id_t sid, bool *rempty)
     59errno_t volsrv_part_is_empty(service_id_t sid, bool *rempty)
    6060{
    61         int rc;
     61        errno_t rc;
    6262        label_bd_t lbd;
    6363
     
    7878}
    7979
    80 int volsrv_part_empty(service_id_t sid)
     80errno_t volsrv_part_empty(service_id_t sid)
    8181{
    82         int rc;
     82        errno_t rc;
    8383        label_bd_t lbd;
    8484
     
    100100
    101101/** Get block size wrapper for liblabel */
    102 static int empty_get_bsize(void *arg, size_t *bsize)
     102static errno_t empty_get_bsize(void *arg, size_t *bsize)
    103103{
    104104        service_id_t svc_id = *(service_id_t *)arg;
     
    107107
    108108/** Get number of blocks wrapper for liblabel */
    109 static int empty_get_nblocks(void *arg, aoff64_t *nblocks)
     109static errno_t empty_get_nblocks(void *arg, aoff64_t *nblocks)
    110110{
    111111        service_id_t svc_id = *(service_id_t *)arg;
     
    114114
    115115/** Read blocks wrapper for liblabel */
    116 static int empty_read(void *arg, aoff64_t ba, size_t cnt, void *buf)
     116static errno_t empty_read(void *arg, aoff64_t ba, size_t cnt, void *buf)
    117117{
    118118        service_id_t svc_id = *(service_id_t *)arg;
     
    121121
    122122/** Write blocks wrapper for liblabel */
    123 static int empty_write(void *arg, aoff64_t ba, size_t cnt, const void *data)
     123static errno_t empty_write(void *arg, aoff64_t ba, size_t cnt, const void *data)
    124124{
    125125        service_id_t svc_id = *(service_id_t *)arg;
Note: See TracChangeset for help on using the changeset viewer.