Changeset b7fd2a0 in mainline for uspace/lib/ext4/include


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/lib/ext4/include/ext4
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ext4/include/ext4/balloc.h

    r36f0738 rb7fd2a0  
    3737#include "types.h"
    3838
    39 extern int ext4_balloc_free_block(ext4_inode_ref_t *, uint32_t);
    40 extern int ext4_balloc_free_blocks(ext4_inode_ref_t *, uint32_t, uint32_t);
     39extern errno_t ext4_balloc_free_block(ext4_inode_ref_t *, uint32_t);
     40extern errno_t ext4_balloc_free_blocks(ext4_inode_ref_t *, uint32_t, uint32_t);
    4141extern uint32_t ext4_balloc_get_first_data_block_in_group(ext4_superblock_t *,
    4242    ext4_block_group_ref_t *);
    43 extern int ext4_balloc_alloc_block(ext4_inode_ref_t *, uint32_t *);
    44 extern int ext4_balloc_try_alloc_block(ext4_inode_ref_t *, uint32_t, bool *);
     43extern errno_t ext4_balloc_alloc_block(ext4_inode_ref_t *, uint32_t *);
     44extern errno_t ext4_balloc_try_alloc_block(ext4_inode_ref_t *, uint32_t, bool *);
    4545
    4646#endif
  • uspace/lib/ext4/include/ext4/bitmap.h

    r36f0738 rb7fd2a0  
    4040extern void ext4_bitmap_set_bit(uint8_t *, uint32_t);
    4141extern bool ext4_bitmap_is_free_bit(uint8_t *, uint32_t);
    42 extern int ext4_bitmap_find_free_byte_and_set_bit(uint8_t *, uint32_t,
     42extern errno_t ext4_bitmap_find_free_byte_and_set_bit(uint8_t *, uint32_t,
    4343    uint32_t *, uint32_t);
    44 extern int ext4_bitmap_find_free_bit_and_set(uint8_t *, uint32_t, uint32_t *,
     44extern errno_t ext4_bitmap_find_free_bit_and_set(uint8_t *, uint32_t, uint32_t *,
    4545    uint32_t);
    4646
  • uspace/lib/ext4/include/ext4/directory.h

    r36f0738 rb7fd2a0  
    5353    ext4_directory_entry_ll_t *, uint8_t);
    5454
    55 extern int ext4_directory_iterator_init(ext4_directory_iterator_t *,
     55extern errno_t ext4_directory_iterator_init(ext4_directory_iterator_t *,
    5656    ext4_inode_ref_t *, aoff64_t);
    57 extern int ext4_directory_iterator_next(ext4_directory_iterator_t *);
    58 extern int ext4_directory_iterator_fini(ext4_directory_iterator_t *);
     57extern errno_t ext4_directory_iterator_next(ext4_directory_iterator_t *);
     58extern errno_t ext4_directory_iterator_fini(ext4_directory_iterator_t *);
    5959
    6060extern void ext4_directory_write_entry(ext4_superblock_t *,
    6161    ext4_directory_entry_ll_t *, uint16_t, ext4_inode_ref_t *,
    6262    const char *, size_t);
    63 extern int ext4_directory_add_entry(ext4_inode_ref_t *, const char *,
     63extern errno_t ext4_directory_add_entry(ext4_inode_ref_t *, const char *,
    6464    ext4_inode_ref_t *);
    65 extern int ext4_directory_find_entry(ext4_directory_search_result_t *,
     65extern errno_t ext4_directory_find_entry(ext4_directory_search_result_t *,
    6666    ext4_inode_ref_t *, const char *);
    67 extern int ext4_directory_remove_entry(ext4_inode_ref_t *, const char *);
     67extern errno_t ext4_directory_remove_entry(ext4_inode_ref_t *, const char *);
    6868
    69 extern int ext4_directory_try_insert_entry(ext4_superblock_t *, block_t *,
     69extern errno_t ext4_directory_try_insert_entry(ext4_superblock_t *, block_t *,
    7070    ext4_inode_ref_t *, const char *, uint32_t);
    7171
    72 extern int ext4_directory_find_in_block(block_t *, ext4_superblock_t *, size_t,
     72extern errno_t ext4_directory_find_in_block(block_t *, ext4_superblock_t *, size_t,
    7373    const char *, ext4_directory_entry_ll_t **);
    7474
    75 extern int ext4_directory_destroy_result(ext4_directory_search_result_t *);
     75extern errno_t ext4_directory_destroy_result(ext4_directory_search_result_t *);
    7676
    7777#endif
  • uspace/lib/ext4/include/ext4/directory_index.h

    r36f0738 rb7fd2a0  
    6565    uint32_t);
    6666
    67 extern int ext4_directory_dx_init(ext4_inode_ref_t *);
    68 extern int ext4_directory_dx_find_entry(ext4_directory_search_result_t *,
     67extern errno_t ext4_directory_dx_init(ext4_inode_ref_t *);
     68extern errno_t ext4_directory_dx_find_entry(ext4_directory_search_result_t *,
    6969    ext4_inode_ref_t *, size_t, const char *);
    70 extern int ext4_directory_dx_add_entry(ext4_inode_ref_t *, ext4_inode_ref_t *,
     70extern errno_t ext4_directory_dx_add_entry(ext4_inode_ref_t *, ext4_inode_ref_t *,
    7171    const char *);
    7272
  • uspace/lib/ext4/include/ext4/extent.h

    r36f0738 rb7fd2a0  
    6161extern void ext4_extent_header_set_generation(ext4_extent_header_t *, uint32_t);
    6262
    63 extern int ext4_extent_find_block(ext4_inode_ref_t *, uint32_t, uint32_t *);
    64 extern int ext4_extent_release_blocks_from(ext4_inode_ref_t *, uint32_t);
     63extern errno_t ext4_extent_find_block(ext4_inode_ref_t *, uint32_t, uint32_t *);
     64extern errno_t ext4_extent_release_blocks_from(ext4_inode_ref_t *, uint32_t);
    6565
    66 extern int ext4_extent_append_block(ext4_inode_ref_t *, uint32_t *, uint32_t *,
     66extern errno_t ext4_extent_append_block(ext4_inode_ref_t *, uint32_t *, uint32_t *,
    6767    bool);
    6868
  • uspace/lib/ext4/include/ext4/filesystem.h

    r36f0738 rb7fd2a0  
    3939#include "ext4/types.h"
    4040
    41 extern int ext4_filesystem_probe(service_id_t);
    42 extern int ext4_filesystem_open(ext4_instance_t *, service_id_t,
     41extern errno_t ext4_filesystem_probe(service_id_t);
     42extern errno_t ext4_filesystem_open(ext4_instance_t *, service_id_t,
    4343    enum cache_mode, aoff64_t *, ext4_filesystem_t **);
    44 extern int ext4_filesystem_close(ext4_filesystem_t *);
     44extern errno_t ext4_filesystem_close(ext4_filesystem_t *);
    4545extern uint32_t ext4_filesystem_blockaddr2_index_in_group(ext4_superblock_t *,
    4646    uint32_t);
     
    4848    uint32_t, uint32_t);
    4949extern uint32_t ext4_filesystem_blockaddr2group(ext4_superblock_t *, uint64_t);
    50 extern int ext4_filesystem_get_block_group_ref(ext4_filesystem_t *, uint32_t,
     50extern errno_t ext4_filesystem_get_block_group_ref(ext4_filesystem_t *, uint32_t,
    5151    ext4_block_group_ref_t **);
    52 extern int ext4_filesystem_put_block_group_ref(ext4_block_group_ref_t *);
    53 extern int ext4_filesystem_get_inode_ref(ext4_filesystem_t *, uint32_t,
     52extern errno_t ext4_filesystem_put_block_group_ref(ext4_block_group_ref_t *);
     53extern errno_t ext4_filesystem_get_inode_ref(ext4_filesystem_t *, uint32_t,
    5454    ext4_inode_ref_t **);
    55 extern int ext4_filesystem_put_inode_ref(ext4_inode_ref_t *);
    56 extern int ext4_filesystem_alloc_inode(ext4_filesystem_t *, ext4_inode_ref_t **,
     55extern errno_t ext4_filesystem_put_inode_ref(ext4_inode_ref_t *);
     56extern errno_t ext4_filesystem_alloc_inode(ext4_filesystem_t *, ext4_inode_ref_t **,
    5757    int);
    58 extern int ext4_filesystem_free_inode(ext4_inode_ref_t *);
    59 extern int ext4_filesystem_truncate_inode(ext4_inode_ref_t *, aoff64_t);
    60 extern int ext4_filesystem_get_inode_data_block_index(ext4_inode_ref_t *,
     58extern errno_t ext4_filesystem_free_inode(ext4_inode_ref_t *);
     59extern errno_t ext4_filesystem_truncate_inode(ext4_inode_ref_t *, aoff64_t);
     60extern errno_t ext4_filesystem_get_inode_data_block_index(ext4_inode_ref_t *,
    6161    aoff64_t iblock, uint32_t *);
    62 extern int ext4_filesystem_set_inode_data_block_index(ext4_inode_ref_t *,
     62extern errno_t ext4_filesystem_set_inode_data_block_index(ext4_inode_ref_t *,
    6363    aoff64_t, uint32_t);
    64 extern int ext4_filesystem_release_inode_block(ext4_inode_ref_t *, uint32_t);
    65 extern int ext4_filesystem_append_inode_block(ext4_inode_ref_t *, uint32_t *,
     64extern errno_t ext4_filesystem_release_inode_block(ext4_inode_ref_t *, uint32_t);
     65extern errno_t ext4_filesystem_append_inode_block(ext4_inode_ref_t *, uint32_t *,
    6666    uint32_t *);
    6767uint32_t ext4_filesystem_bg_get_backup_blocks(ext4_block_group_ref_t *bg);
  • uspace/lib/ext4/include/ext4/hash.h

    r36f0738 rb7fd2a0  
    3636#include "ext4/types.h"
    3737
    38 extern int ext4_hash_string(ext4_hash_info_t *, int, const char *);
     38extern errno_t ext4_hash_string(ext4_hash_info_t *, int, const char *);
    3939
    4040#endif
  • uspace/lib/ext4/include/ext4/ialloc.h

    r36f0738 rb7fd2a0  
    3636#include "ext4/types.h"
    3737
    38 extern int ext4_ialloc_free_inode(ext4_filesystem_t *, uint32_t, bool);
    39 extern int ext4_ialloc_alloc_inode(ext4_filesystem_t *, uint32_t *, bool);
     38extern errno_t ext4_ialloc_free_inode(ext4_filesystem_t *, uint32_t, bool);
     39extern errno_t ext4_ialloc_alloc_inode(ext4_filesystem_t *, uint32_t *, bool);
    4040
    4141#endif
  • uspace/lib/ext4/include/ext4/inode.h

    r36f0738 rb7fd2a0  
    5959extern uint64_t ext4_inode_get_blocks_count(ext4_superblock_t *,
    6060    ext4_inode_t *);
    61 extern int ext4_inode_set_blocks_count(ext4_superblock_t *, ext4_inode_t *,
     61extern errno_t ext4_inode_set_blocks_count(ext4_superblock_t *, ext4_inode_t *,
    6262    uint64_t);
    6363extern uint32_t ext4_inode_get_flags(ext4_inode_t *);
  • uspace/lib/ext4/include/ext4/ops.h

    r36f0738 rb7fd2a0  
    4040extern libfs_ops_t ext4_libfs_ops;
    4141
    42 extern int ext4_global_init(void);
    43 extern int ext4_global_fini(void);
     42extern errno_t ext4_global_init(void);
     43extern errno_t ext4_global_fini(void);
    4444
    45 extern int ext4_node_get_core(fs_node_t **, ext4_instance_t *, fs_index_t);
    46 extern int ext4_node_put(fs_node_t *);
     45extern errno_t ext4_node_get_core(fs_node_t **, ext4_instance_t *, fs_index_t);
     46extern errno_t ext4_node_put(fs_node_t *);
    4747
    4848
  • uspace/lib/ext4/include/ext4/superblock.h

    r36f0738 rb7fd2a0  
    152152extern bool ext4_superblock_has_feature_read_only(ext4_superblock_t *,
    153153    uint32_t);
    154 extern int ext4_superblock_read_direct(service_id_t, ext4_superblock_t **);
    155 extern int ext4_superblock_write_direct(service_id_t, ext4_superblock_t *);
     154extern errno_t ext4_superblock_read_direct(service_id_t, ext4_superblock_t **);
     155extern errno_t ext4_superblock_write_direct(service_id_t, ext4_superblock_t *);
    156156extern void ext4_superblock_release(ext4_superblock_t *);
    157 extern int ext4_superblock_check_sanity(ext4_superblock_t *);
     157extern errno_t ext4_superblock_check_sanity(ext4_superblock_t *);
    158158
    159159extern uint32_t ext4_superblock_get_block_group_count(ext4_superblock_t *);
Note: See TracChangeset for help on using the changeset viewer.