Index: uspace/srv/fs/mfs/mfs_balloc.c
===================================================================
--- uspace/srv/fs/mfs/mfs_balloc.c	(revision 1eaa3cf707e6d408ffe5c523ca554778716f5394)
+++ uspace/srv/fs/mfs/mfs_balloc.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -38,11 +38,11 @@
     const bool native, unsigned start_bit);
 
-static int
+static errno_t
 mfs_free_bit(struct mfs_instance *inst, uint32_t idx, bmap_id_t bid);
 
-static int
+static errno_t
 mfs_alloc_bit(struct mfs_instance *inst, uint32_t *idx, bmap_id_t bid);
 
-static int
+static errno_t
 mfs_count_free_bits(struct mfs_instance *inst, bmap_id_t bid, uint32_t *free);
 
@@ -54,10 +54,10 @@
  * 			the new inode will be saved.
  *
- * @return		EOK on success or a negative error code.
- */
-int
+ * @return		EOK on success or an error code.
+ */
+errno_t
 mfs_alloc_inode(struct mfs_instance *inst, uint32_t *inum)
 {
-	int r = mfs_alloc_bit(inst, inum, BMAP_INODE);
+	errno_t r = mfs_alloc_bit(inst, inum, BMAP_INODE);
 	return r;
 }
@@ -68,7 +68,7 @@
  * @param inum		Number of the inode to free.
  *
- * @return		EOK on success or a negative error code.
- */
-int
+ * @return		EOK on success or an error code.
+ */
+errno_t
 mfs_free_inode(struct mfs_instance *inst, uint32_t inum)
 {
@@ -82,10 +82,10 @@
  * 			of the zone will be saved.
  *
- * @return		EOK on success or a negative error code.
- */
-int
+ * @return		EOK on success or an error code.
+ */
+errno_t
 mfs_alloc_zone(struct mfs_instance *inst, uint32_t *zone)
 {
-	int r = mfs_alloc_bit(inst, zone, BMAP_ZONE);
+	errno_t r = mfs_alloc_bit(inst, zone, BMAP_ZONE);
 	if (r != EOK)
 		return r;
@@ -105,10 +105,10 @@
  * @param zone		Index of the zone to free.
  *
- * @return		EOK on success or a negative error code.
- */
-int
+ * @return		EOK on success or an error code.
+ */
+errno_t
 mfs_free_zone(struct mfs_instance *inst, uint32_t zone)
 {
-	int r;
+	errno_t r;
 
 	zone -= inst->sbi->firstdatazone - 1;
@@ -132,7 +132,7 @@
  *                      will be stored.
  *
- * @return              EOK on success or a negative error code.
- */
-int
+ * @return              EOK on success or an error code.
+ */
+errno_t
 mfs_count_free_zones(struct mfs_instance *inst, uint32_t *zones)
 {
@@ -146,8 +146,8 @@
  *                      will be stored.
  *
- * @return              EOK on success or a negative error code.
- */
-
-int
+ * @return              EOK on success or an error code.
+ */
+
+errno_t
 mfs_count_free_inodes(struct mfs_instance *inst, uint32_t *inodes)
 {
@@ -162,10 +162,10 @@
  *                      will be stores.
  *
- * @return              EOK on success or a negative error code.
- */
-static int
+ * @return              EOK on success or an error code.
+ */
+static errno_t
 mfs_count_free_bits(struct mfs_instance *inst, bmap_id_t bid, uint32_t *free)
 {
-	int r;
+	errno_t r;
 	unsigned start_block;
 	unsigned long nblocks;
@@ -226,11 +226,11 @@
  * 			BMAP_INODE if operating on the inode's bitmap.
  *
- * @return		EOK on success or a negative error code.
- */
-static int
+ * @return		EOK on success or an error code.
+ */
+static errno_t
 mfs_free_bit(struct mfs_instance *inst, uint32_t idx, bmap_id_t bid)
 {
 	struct mfs_sb_info *sbi;
-	int r;
+	errno_t r;
 	unsigned start_block;
 	unsigned *search;
@@ -246,5 +246,5 @@
 			printf(NAME ": Error! Trying to free beyond the "
 			    "bitmap max size\n");
-			return -1;
+			return EIO;
 		}
 	} else {
@@ -254,5 +254,5 @@
 			printf(NAME ": Error! Trying to free beyond the "
 			    "bitmap max size\n");
-			return -1;
+			return EIO;
 		}
 	}
@@ -293,7 +293,7 @@
  * 			BMAP_INODE if operating on the inode's bitmap.
  *
- * @return		EOK on success or a negative error code.
- */
-static int
+ * @return		EOK on success or an error code.
+ */
+static errno_t
 mfs_alloc_bit(struct mfs_instance *inst, uint32_t *idx, bmap_id_t bid)
 {
@@ -303,5 +303,6 @@
 	unsigned *search, i, start_block;
 	unsigned bits_per_block;
-	int r, freebit;
+	errno_t r;
+	int freebit;
 
 	sbi = inst->sbi;
