Changeset b7fd2a0 in mainline for uspace/srv/fs/mfs/mfs.h


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.h

    r36f0738 rb7fd2a0  
    169169extern libfs_ops_t mfs_libfs_ops;
    170170
    171 extern int
     171extern errno_t
    172172mfs_global_init(void);
    173173
    174174/* mfs_inode.c */
    175 extern int
     175extern errno_t
    176176mfs_get_inode(struct mfs_instance *inst, struct mfs_ino_info **ino_i,
    177177    fs_index_t index);
    178178
    179 extern int
     179extern errno_t
    180180mfs_put_inode(struct mfs_node *mnode);
    181181
    182 extern int
     182extern errno_t
    183183mfs_inode_shrink(struct mfs_node *mnode, size_t size_shrink);
    184184
    185185/* mfs_rw.c */
    186 extern int
     186extern errno_t
    187187mfs_read_map(uint32_t *b, const struct mfs_node *mnode, const uint32_t pos);
    188188
    189 extern int
     189extern errno_t
    190190mfs_write_map(struct mfs_node *mnode, uint32_t pos, uint32_t new_zone,
    191191    uint32_t *old_zone);
    192192
    193 extern int
     193extern errno_t
    194194mfs_prune_ind_zones(struct mfs_node *mnode, size_t new_size);
    195195
    196196/* mfs_dentry.c */
    197 extern int
     197extern errno_t
    198198mfs_read_dentry(struct mfs_node *mnode,
    199199    struct mfs_dentry_info *d_info, unsigned index);
    200200
    201 extern int
     201extern errno_t
    202202mfs_write_dentry(struct mfs_dentry_info *d_info);
    203203
    204 extern int
     204extern errno_t
    205205mfs_remove_dentry(struct mfs_node *mnode, const char *d_name);
    206206
    207 extern int
     207extern errno_t
    208208mfs_insert_dentry(struct mfs_node *mnode, const char *d_name, fs_index_t d_inum);
    209209
    210210/* mfs_balloc.c */
    211 extern int
     211extern errno_t
    212212mfs_alloc_inode(struct mfs_instance *inst, uint32_t *inum);
    213213
    214 extern int
     214extern errno_t
    215215mfs_free_inode(struct mfs_instance *inst, uint32_t inum);
    216216
    217 extern int
     217extern errno_t
    218218mfs_alloc_zone(struct mfs_instance *inst, uint32_t *zone);
    219219
    220 extern int
     220extern errno_t
    221221mfs_free_zone(struct mfs_instance *inst, uint32_t zone);
    222222
    223 extern int
     223extern errno_t
    224224mfs_count_free_zones(struct mfs_instance *inst, uint32_t *zones);
    225225
    226 extern int
     226extern errno_t
    227227mfs_count_free_inodes(struct mfs_instance *inst, uint32_t *inodes);
    228228
Note: See TracChangeset for help on using the changeset viewer.