Changeset b7fd2a0 in mainline for uspace/srv/fs/mfs/mfs_inode.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/fs/mfs/mfs_inode.c

    r36f0738 rb7fd2a0  
    3434#include "mfs.h"
    3535
    36 static int
     36static errno_t
    3737mfs_write_inode_raw(struct mfs_node *mnode);
    3838
    39 static int
     39static errno_t
    4040mfs2_write_inode_raw(struct mfs_node *mnode);
    4141
    42 static int
     42static errno_t
    4343mfs_read_inode_raw(const struct mfs_instance *instance,
    4444    struct mfs_ino_info **ino_ptr, uint16_t inum);
    4545
    46 static int
     46static errno_t
    4747mfs2_read_inode_raw(const struct mfs_instance *instance,
    4848    struct mfs_ino_info **ino_ptr, uint32_t inum);
     
    5757 * @return              EOK on success or an error code.
    5858 */
    59 int
     59errno_t
    6060mfs_get_inode(struct mfs_instance *inst, struct mfs_ino_info **ino_i,
    6161    fs_index_t index)
    6262{
    6363        struct mfs_sb_info *sbi = inst->sbi;
    64         int r;
     64        errno_t r;
    6565
    6666        if (sbi->fs_version == MFS_VERSION_V1) {
     
    7575}
    7676
    77 static int
     77static errno_t
    7878mfs_read_inode_raw(const struct mfs_instance *instance,
    7979    struct mfs_ino_info **ino_ptr, uint16_t inum)
     
    8484        block_t *b;
    8585        int i;
    86         int r;
     86        errno_t r;
    8787
    8888        sbi = instance->sbi;
     
    135135}
    136136
    137 static int
     137static errno_t
    138138mfs2_read_inode_raw(const struct mfs_instance *instance,
    139139    struct mfs_ino_info **ino_ptr, uint32_t inum)
     
    144144        block_t *b;
    145145        int i;
    146         int r;
     146        errno_t r;
    147147
    148148        ino_i = malloc(sizeof(*ino_i));
     
    203203 * @return              EOK on success or an error code.
    204204 */
    205 int
     205errno_t
    206206mfs_put_inode(struct mfs_node *mnode)
    207207{
    208         int rc = EOK;
     208        errno_t rc = EOK;
    209209
    210210        if (!mnode->ino_i->dirty)
     
    223223}
    224224
    225 static int
     225static errno_t
    226226mfs_write_inode_raw(struct mfs_node *mnode)
    227227{
    228228        int i;
    229         int r;
     229        errno_t r;
    230230        block_t *b;
    231231        struct mfs_ino_info *ino_i = mnode->ino_i;
     
    267267}
    268268
    269 static int
     269static errno_t
    270270mfs2_write_inode_raw(struct mfs_node *mnode)
    271271{
     
    274274        block_t *b;
    275275        int i;
    276         int r;
     276        errno_t r;
    277277
    278278        const uint32_t inum = ino_i->index - 1;
     
    321321 * @return              EOK on success or an error code.
    322322 */
    323 int
     323errno_t
    324324mfs_inode_shrink(struct mfs_node *mnode, size_t size_shrink)
    325325{
     
    327327        struct mfs_ino_info *ino_i = mnode->ino_i;
    328328        const size_t bs = sbi->block_size;
    329         int r;
     329        errno_t r;
    330330
    331331        if (size_shrink == 0) {
Note: See TracChangeset for help on using the changeset viewer.