Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/mfs/mfs_balloc.c

    r1eaa3cf rb7fd2a0  
    3838    const bool native, unsigned start_bit);
    3939
    40 static int
     40static errno_t
    4141mfs_free_bit(struct mfs_instance *inst, uint32_t idx, bmap_id_t bid);
    4242
    43 static int
     43static errno_t
    4444mfs_alloc_bit(struct mfs_instance *inst, uint32_t *idx, bmap_id_t bid);
    4545
    46 static int
     46static errno_t
    4747mfs_count_free_bits(struct mfs_instance *inst, bmap_id_t bid, uint32_t *free);
    4848
     
    5454 *                      the new inode will be saved.
    5555 *
    56  * @return              EOK on success or a negative error code.
    57  */
    58 int
     56 * @return              EOK on success or an error code.
     57 */
     58errno_t
    5959mfs_alloc_inode(struct mfs_instance *inst, uint32_t *inum)
    6060{
    61         int r = mfs_alloc_bit(inst, inum, BMAP_INODE);
     61        errno_t r = mfs_alloc_bit(inst, inum, BMAP_INODE);
    6262        return r;
    6363}
     
    6868 * @param inum          Number of the inode to free.
    6969 *
    70  * @return              EOK on success or a negative error code.
    71  */
    72 int
     70 * @return              EOK on success or an error code.
     71 */
     72errno_t
    7373mfs_free_inode(struct mfs_instance *inst, uint32_t inum)
    7474{
     
    8282 *                      of the zone will be saved.
    8383 *
    84  * @return              EOK on success or a negative error code.
    85  */
    86 int
     84 * @return              EOK on success or an error code.
     85 */
     86errno_t
    8787mfs_alloc_zone(struct mfs_instance *inst, uint32_t *zone)
    8888{
    89         int r = mfs_alloc_bit(inst, zone, BMAP_ZONE);
     89        errno_t r = mfs_alloc_bit(inst, zone, BMAP_ZONE);
    9090        if (r != EOK)
    9191                return r;
     
    105105 * @param zone          Index of the zone to free.
    106106 *
    107  * @return              EOK on success or a negative error code.
    108  */
    109 int
     107 * @return              EOK on success or an error code.
     108 */
     109errno_t
    110110mfs_free_zone(struct mfs_instance *inst, uint32_t zone)
    111111{
    112         int r;
     112        errno_t r;
    113113
    114114        zone -= inst->sbi->firstdatazone - 1;
     
    132132 *                      will be stored.
    133133 *
    134  * @return              EOK on success or a negative error code.
    135  */
    136 int
     134 * @return              EOK on success or an error code.
     135 */
     136errno_t
    137137mfs_count_free_zones(struct mfs_instance *inst, uint32_t *zones)
    138138{
     
    146146 *                      will be stored.
    147147 *
    148  * @return              EOK on success or a negative error code.
    149  */
    150 
    151 int
     148 * @return              EOK on success or an error code.
     149 */
     150
     151errno_t
    152152mfs_count_free_inodes(struct mfs_instance *inst, uint32_t *inodes)
    153153{
     
    162162 *                      will be stores.
    163163 *
    164  * @return              EOK on success or a negative error code.
    165  */
    166 static int
     164 * @return              EOK on success or an error code.
     165 */
     166static errno_t
    167167mfs_count_free_bits(struct mfs_instance *inst, bmap_id_t bid, uint32_t *free)
    168168{
    169         int r;
     169        errno_t r;
    170170        unsigned start_block;
    171171        unsigned long nblocks;
     
    226226 *                      BMAP_INODE if operating on the inode's bitmap.
    227227 *
    228  * @return              EOK on success or a negative error code.
    229  */
    230 static int
     228 * @return              EOK on success or an error code.
     229 */
     230static errno_t
    231231mfs_free_bit(struct mfs_instance *inst, uint32_t idx, bmap_id_t bid)
    232232{
    233233        struct mfs_sb_info *sbi;
    234         int r;
     234        errno_t r;
    235235        unsigned start_block;
    236236        unsigned *search;
     
    246246                        printf(NAME ": Error! Trying to free beyond the "
    247247                            "bitmap max size\n");
    248                         return -1;
     248                        return EIO;
    249249                }
    250250        } else {
     
    254254                        printf(NAME ": Error! Trying to free beyond the "
    255255                            "bitmap max size\n");
    256                         return -1;
     256                        return EIO;
    257257                }
    258258        }
     
    293293 *                      BMAP_INODE if operating on the inode's bitmap.
    294294 *
    295  * @return              EOK on success or a negative error code.
    296  */
    297 static int
     295 * @return              EOK on success or an error code.
     296 */
     297static errno_t
    298298mfs_alloc_bit(struct mfs_instance *inst, uint32_t *idx, bmap_id_t bid)
    299299{
     
    303303        unsigned *search, i, start_block;
    304304        unsigned bits_per_block;
    305         int r, freebit;
     305        errno_t r;
     306        int freebit;
    306307
    307308        sbi = inst->sbi;
Note: See TracChangeset for help on using the changeset viewer.