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

    r36f0738 rb7fd2a0  
    4242 * @return              EOK on success or an error code.
    4343 */
    44 int
     44errno_t
    4545mfs_read_dentry(struct mfs_node *mnode,
    4646    struct mfs_dentry_info *d_info, unsigned index)
     
    5252        block_t *b;
    5353
    54         int r = mfs_read_map(&block, mnode, index * sbi->dirsize);
     54        errno_t r = mfs_read_map(&block, mnode, index * sbi->dirsize);
    5555        if (r != EOK)
    5656                goto out_err;
     
    105105 * @return       EOK on success or an error code.
    106106 */
    107 int
     107errno_t
    108108mfs_write_dentry(struct mfs_dentry_info *d_info)
    109109{
     
    114114        block_t *b;
    115115        uint32_t block;
    116         int r;
     116        errno_t r;
    117117
    118118        r = mfs_read_map(&block, mnode, d_off_bytes);
     
    156156 * @return              EOK on success or an error code.
    157157 */
    158 int
     158errno_t
    159159mfs_remove_dentry(struct mfs_node *mnode, const char *d_name)
    160160{
    161161        struct mfs_sb_info *sbi = mnode->instance->sbi;
    162162        struct mfs_dentry_info d_info;
    163         int r;
     163        errno_t r;
    164164
    165165        const size_t name_len = str_size(d_name);
     
    197197 * @return              EOK on success or an error code.
    198198 */
    199 int
     199errno_t
    200200mfs_insert_dentry(struct mfs_node *mnode, const char *d_name,
    201201    fs_index_t d_inum)
    202202{
    203         int r;
     203        errno_t r;
    204204        struct mfs_sb_info *sbi = mnode->instance->sbi;
    205205        struct mfs_dentry_info d_info;
Note: See TracChangeset for help on using the changeset viewer.