Index: uspace/lib/ext4/src/ops.c
===================================================================
--- uspace/lib/ext4/src/ops.c	(revision 38d150e6238ab44c861f6486e46454e07caeb0f0)
+++ uspace/lib/ext4/src/ops.c	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
@@ -58,23 +58,23 @@
 /* Forward declarations of auxiliary functions */
 
-static int ext4_read_directory(ipc_callid_t, aoff64_t, size_t,
+static errno_t ext4_read_directory(ipc_callid_t, aoff64_t, size_t,
     ext4_instance_t *, ext4_inode_ref_t *, size_t *);
-static int ext4_read_file(ipc_callid_t, aoff64_t, size_t, ext4_instance_t *,
+static errno_t ext4_read_file(ipc_callid_t, aoff64_t, size_t, ext4_instance_t *,
     ext4_inode_ref_t *, size_t *);
 static bool ext4_is_dots(const uint8_t *, size_t);
-static int ext4_instance_get(service_id_t, ext4_instance_t **);
+static errno_t ext4_instance_get(service_id_t, ext4_instance_t **);
 
 /* Forward declarations of ext4 libfs operations. */
 
-static int ext4_root_get(fs_node_t **, service_id_t);
-static int ext4_match(fs_node_t **, fs_node_t *, const char *);
-static int ext4_node_get(fs_node_t **, service_id_t, fs_index_t);
-static int ext4_node_open(fs_node_t *);
-       int ext4_node_put(fs_node_t *);
-static int ext4_create_node(fs_node_t **, service_id_t, int);
-static int ext4_destroy_node(fs_node_t *);
-static int ext4_link(fs_node_t *, fs_node_t *, const char *);
-static int ext4_unlink(fs_node_t *, fs_node_t *, const char *);
-static int ext4_has_children(bool *, fs_node_t *);
+static errno_t ext4_root_get(fs_node_t **, service_id_t);
+static errno_t ext4_match(fs_node_t **, fs_node_t *, const char *);
+static errno_t ext4_node_get(fs_node_t **, service_id_t, fs_index_t);
+static errno_t ext4_node_open(fs_node_t *);
+       errno_t ext4_node_put(fs_node_t *);
+static errno_t ext4_create_node(fs_node_t **, service_id_t, int);
+static errno_t ext4_destroy_node(fs_node_t *);
+static errno_t ext4_link(fs_node_t *, fs_node_t *, const char *);
+static errno_t ext4_unlink(fs_node_t *, fs_node_t *, const char *);
+static errno_t ext4_has_children(bool *, fs_node_t *);
 static fs_index_t ext4_index_get(fs_node_t *);
 static aoff64_t ext4_size_get(fs_node_t *);
@@ -83,7 +83,7 @@
 static bool ext4_is_file(fs_node_t *node);
 static service_id_t ext4_service_get(fs_node_t *node);
-static int ext4_size_block(service_id_t, uint32_t *);
-static int ext4_total_block_count(service_id_t, uint64_t *);
-static int ext4_free_block_count(service_id_t, uint64_t *);
+static errno_t ext4_size_block(service_id_t, uint32_t *);
+static errno_t ext4_total_block_count(service_id_t, uint64_t *);
+static errno_t ext4_free_block_count(service_id_t, uint64_t *);
 
 /* Static variables */
@@ -138,5 +138,5 @@
  *
  */
-int ext4_global_init(void)
+errno_t ext4_global_init(void)
 {
 	if (!hash_table_create(&open_nodes, 0, 0, &open_nodes_ops))
@@ -152,5 +152,5 @@
  * @return Error code
  */
-int ext4_global_fini(void)
+errno_t ext4_global_fini(void)
 {
 	hash_table_destroy(&open_nodes);
@@ -170,5 +170,5 @@
  *
  */
-int ext4_instance_get(service_id_t service_id, ext4_instance_t **inst)
+errno_t ext4_instance_get(service_id_t service_id, ext4_instance_t **inst)
 {
 	fibril_mutex_lock(&instance_list_mutex);
@@ -199,5 +199,5 @@
  *
  */
-int ext4_root_get(fs_node_t **rfn, service_id_t service_id)
+errno_t ext4_root_get(fs_node_t **rfn, service_id_t service_id)
 {
 	return ext4_node_get(rfn, service_id, EXT4_INODE_ROOT_INDEX);
@@ -215,5 +215,5 @@
  *
  */
-int ext4_match(fs_node_t **rfn, fs_node_t *pfn, const char *component)
+errno_t ext4_match(fs_node_t **rfn, fs_node_t *pfn, const char *component)
 {
 	ext4_node_t *eparent = EXT4_NODE(pfn);
@@ -226,5 +226,5 @@
 	/* Try to find entry */
 	ext4_directory_search_result_t result;
-	int rc = ext4_directory_find_entry(&result, eparent->inode_ref,
+	errno_t rc = ext4_directory_find_entry(&result, eparent->inode_ref,
 	    component);
 	if (rc != EOK) {
@@ -247,5 +247,5 @@
 
 	/* Destroy search result structure */
-	int const rc2 = ext4_directory_destroy_result(&result);
+	errno_t const rc2 = ext4_directory_destroy_result(&result);
 	return rc == EOK ? rc2 : rc;
 }
@@ -262,8 +262,8 @@
  *
  */
-int ext4_node_get(fs_node_t **rfn, service_id_t service_id, fs_index_t index)
+errno_t ext4_node_get(fs_node_t **rfn, service_id_t service_id, fs_index_t index)
 {
 	ext4_instance_t *inst;
-	int rc = ext4_instance_get(service_id, &inst);
+	errno_t rc = ext4_instance_get(service_id, &inst);
 	if (rc != EOK)
 		return rc;
@@ -281,5 +281,5 @@
  *
  */
-int ext4_node_get_core(fs_node_t **rfn, ext4_instance_t *inst,
+errno_t ext4_node_get_core(fs_node_t **rfn, ext4_instance_t *inst,
     fs_index_t index)
 {
@@ -322,5 +322,5 @@
 	/* Load i-node from filesystem */
 	ext4_inode_ref_t *inode_ref;
-	int rc = ext4_filesystem_get_inode_ref(inst->filesystem, index,
+	errno_t rc = ext4_filesystem_get_inode_ref(inst->filesystem, index,
 	    &inode_ref);
 	if (rc != EOK) {
@@ -355,5 +355,5 @@
  *
  */
-static int ext4_node_put_core(ext4_node_t *enode)
+static errno_t ext4_node_put_core(ext4_node_t *enode)
 {
 	hash_table_remove_item(&open_nodes, &enode->link);
@@ -362,5 +362,5 @@
 	
 	/* Put inode back in filesystem */
-	int rc = ext4_filesystem_put_inode_ref(enode->inode_ref);
+	errno_t rc = ext4_filesystem_put_inode_ref(enode->inode_ref);
 	if (rc != EOK)
 		return rc;
@@ -382,5 +382,5 @@
  *
  */
-int ext4_node_open(fs_node_t *fn)
+errno_t ext4_node_open(fs_node_t *fn)
 {
 	/* Stateless operation */
@@ -396,5 +396,5 @@
  *
  */
-int ext4_node_put(fs_node_t *fn)
+errno_t ext4_node_put(fs_node_t *fn)
 {
 	fibril_mutex_lock(&open_nodes_lock);
@@ -404,5 +404,5 @@
 	enode->references--;
 	if (enode->references == 0) {
-		int rc = ext4_node_put_core(enode);
+		errno_t rc = ext4_node_put_core(enode);
 		if (rc != EOK) {
 			fibril_mutex_unlock(&open_nodes_lock);
@@ -425,5 +425,5 @@
  *
  */
-int ext4_create_node(fs_node_t **rfn, service_id_t service_id, int flags)
+errno_t ext4_create_node(fs_node_t **rfn, service_id_t service_id, int flags)
 {
 	/* Allocate enode */
@@ -443,5 +443,5 @@
 	/* Load instance */
 	ext4_instance_t *inst;
-	int rc = ext4_instance_get(service_id, &inst);
+	errno_t rc = ext4_instance_get(service_id, &inst);
 	if (rc != EOK) {
 		free(enode);
@@ -486,9 +486,9 @@
  *
  */
-int ext4_destroy_node(fs_node_t *fn)
+errno_t ext4_destroy_node(fs_node_t *fn)
 {
 	/* If directory, check for children */
 	bool has_children;
-	int rc = ext4_has_children(&has_children, fn);
+	errno_t rc = ext4_has_children(&has_children, fn);
 	if (rc != EOK) {
 		ext4_node_put(fn);
@@ -537,5 +537,5 @@
  *
  */
-int ext4_link(fs_node_t *pfn, fs_node_t *cfn, const char *name)
+errno_t ext4_link(fs_node_t *pfn, fs_node_t *cfn, const char *name)
 {
 	/* Check maximum name length */
@@ -548,5 +548,5 @@
 	
 	/* Add entry to parent directory */
-	int rc = ext4_directory_add_entry(parent->inode_ref, name,
+	errno_t rc = ext4_directory_add_entry(parent->inode_ref, name,
 	    child->inode_ref);
 	if (rc != EOK)
@@ -610,8 +610,8 @@
  *
  */
-int ext4_unlink(fs_node_t *pfn, fs_node_t *cfn, const char *name)
+errno_t ext4_unlink(fs_node_t *pfn, fs_node_t *cfn, const char *name)
 {
 	bool has_children;
-	int rc = ext4_has_children(&has_children, cfn);
+	errno_t rc = ext4_has_children(&has_children, cfn);
 	if (rc != EOK)
 		return rc;
@@ -683,5 +683,5 @@
  *
  */
-int ext4_has_children(bool *has_children, fs_node_t *fn)
+errno_t ext4_has_children(bool *has_children, fs_node_t *fn)
 {
 	ext4_node_t *enode = EXT4_NODE(fn);
@@ -696,5 +696,5 @@
 	
 	ext4_directory_iterator_t it;
-	int rc = ext4_directory_iterator_init(&it, enode->inode_ref, 0);
+	errno_t rc = ext4_directory_iterator_init(&it, enode->inode_ref, 0);
 	if (rc != EOK)
 		return rc;
@@ -824,8 +824,8 @@
 }
 
-int ext4_size_block(service_id_t service_id, uint32_t *size)
+errno_t ext4_size_block(service_id_t service_id, uint32_t *size)
 {
 	ext4_instance_t *inst;
-	int rc = ext4_instance_get(service_id, &inst);
+	errno_t rc = ext4_instance_get(service_id, &inst);
 	if (rc != EOK)
 		return rc;
@@ -840,8 +840,8 @@
 }
 
-int ext4_total_block_count(service_id_t service_id, uint64_t *count)
+errno_t ext4_total_block_count(service_id_t service_id, uint64_t *count)
 {
 	ext4_instance_t *inst;
-	int rc = ext4_instance_get(service_id, &inst);
+	errno_t rc = ext4_instance_get(service_id, &inst);
 	if (rc != EOK)
 		return rc;
@@ -856,8 +856,8 @@
 }
 
-int ext4_free_block_count(service_id_t service_id, uint64_t *count)
+errno_t ext4_free_block_count(service_id_t service_id, uint64_t *count)
 {
 	ext4_instance_t *inst;
-	int rc = ext4_instance_get(service_id, &inst);
+	errno_t rc = ext4_instance_get(service_id, &inst);
 	if (rc != EOK)
 		return rc;
@@ -907,5 +907,5 @@
  * @return Error code
  */
-static int ext4_fsprobe(service_id_t service_id, vfs_fs_probe_info_t *info)
+static errno_t ext4_fsprobe(service_id_t service_id, vfs_fs_probe_info_t *info)
 {
 	return ext4_filesystem_probe(service_id);
@@ -924,5 +924,5 @@
  *
  */
-static int ext4_mounted(service_id_t service_id, const char *opts,
+static errno_t ext4_mounted(service_id_t service_id, const char *opts,
     fs_index_t *index, aoff64_t *size)
 {
@@ -948,5 +948,5 @@
 	/* Initialize the filesystem */
 	aoff64_t rnsize;
-	int rc = ext4_filesystem_open(inst, service_id, cmode, &rnsize, &fs);
+	errno_t rc = ext4_filesystem_open(inst, service_id, cmode, &rnsize, &fs);
 	if (rc != EOK) {
 		free(inst);
@@ -974,8 +974,8 @@
  *
  */
-static int ext4_unmounted(service_id_t service_id)
+static errno_t ext4_unmounted(service_id_t service_id)
 {
 	ext4_instance_t *inst;
-	int rc = ext4_instance_get(service_id, &inst);
+	errno_t rc = ext4_instance_get(service_id, &inst);
 	if (rc != EOK)
 		return rc;
@@ -1016,5 +1016,5 @@
  *
  */
-static int ext4_read(service_id_t service_id, fs_index_t index, aoff64_t pos,
+static errno_t ext4_read(service_id_t service_id, fs_index_t index, aoff64_t pos,
     size_t *rbytes)
 {
@@ -1030,5 +1030,5 @@
 	
 	ext4_instance_t *inst;
-	int rc = ext4_instance_get(service_id, &inst);
+	errno_t rc = ext4_instance_get(service_id, &inst);
 	if (rc != EOK) {
 		async_answer_0(callid, rc);
@@ -1059,5 +1059,5 @@
 	}
 	
-	int const rc2 = ext4_filesystem_put_inode_ref(inode_ref);
+	errno_t const rc2 = ext4_filesystem_put_inode_ref(inode_ref);
 	
 	return rc == EOK ? rc2 : rc;
@@ -1095,9 +1095,9 @@
  *
  */
-int ext4_read_directory(ipc_callid_t callid, aoff64_t pos, size_t size,
+errno_t ext4_read_directory(ipc_callid_t callid, aoff64_t pos, size_t size,
     ext4_instance_t *inst, ext4_inode_ref_t *inode_ref, size_t *rbytes)
 {
 	ext4_directory_iterator_t it;
-	int rc = ext4_directory_iterator_init(&it, inode_ref, pos);
+	errno_t rc = ext4_directory_iterator_init(&it, inode_ref, pos);
 	if (rc != EOK) {
 		async_answer_0(callid, rc);
@@ -1186,5 +1186,5 @@
  *
  */
-int ext4_read_file(ipc_callid_t callid, aoff64_t pos, size_t size,
+errno_t ext4_read_file(ipc_callid_t callid, aoff64_t pos, size_t size,
     ext4_instance_t *inst, ext4_inode_ref_t *inode_ref, size_t *rbytes)
 {
@@ -1211,5 +1211,5 @@
 	/* Get the real block number */
 	uint32_t fs_block;
-	int rc = ext4_filesystem_get_inode_data_block_index(inode_ref,
+	errno_t rc = ext4_filesystem_get_inode_data_block_index(inode_ref,
 	    file_block, &fs_block);
 	if (rc != EOK) {
@@ -1275,9 +1275,9 @@
  *
  */
-static int ext4_write(service_id_t service_id, fs_index_t index, aoff64_t pos,
+static errno_t ext4_write(service_id_t service_id, fs_index_t index, aoff64_t pos,
     size_t *wbytes, aoff64_t *nsize)
 {
 	fs_node_t *fn;
-	int rc = ext4_node_get(&fn, service_id, index);
+	errno_t rc = ext4_node_get(&fn, service_id, index);
 	if (rc != EOK)
 		return rc;
@@ -1397,5 +1397,5 @@
 	;
 
-	int const rc2 = ext4_node_put(fn);
+	errno_t const rc2 = ext4_node_put(fn);
 	return rc == EOK ? rc2 : rc;
 }
@@ -1412,9 +1412,9 @@
  *
  */
-static int ext4_truncate(service_id_t service_id, fs_index_t index,
+static errno_t ext4_truncate(service_id_t service_id, fs_index_t index,
     aoff64_t new_size)
 {
 	fs_node_t *fn;
-	int rc = ext4_node_get(&fn, service_id, index);
+	errno_t rc = ext4_node_get(&fn, service_id, index);
 	if (rc != EOK)
 		return rc;
@@ -1424,5 +1424,5 @@
 	
 	rc = ext4_filesystem_truncate_inode(inode_ref, new_size);
-	int const rc2 = ext4_node_put(fn);
+	errno_t const rc2 = ext4_node_put(fn);
 	
 	return rc == EOK ? rc2 : rc;
@@ -1437,5 +1437,5 @@
  *
  */
-static int ext4_close(service_id_t service_id, fs_index_t index)
+static errno_t ext4_close(service_id_t service_id, fs_index_t index)
 {
 	return EOK;
@@ -1450,8 +1450,8 @@
  *
  */
-static int ext4_destroy(service_id_t service_id, fs_index_t index)
+static errno_t ext4_destroy(service_id_t service_id, fs_index_t index)
 {
 	fs_node_t *fn;
-	int rc = ext4_node_get(&fn, service_id, index);
+	errno_t rc = ext4_node_get(&fn, service_id, index);
 	if (rc != EOK)
 		return rc;
@@ -1467,8 +1467,8 @@
  *
  */
-static int ext4_sync(service_id_t service_id, fs_index_t index)
+static errno_t ext4_sync(service_id_t service_id, fs_index_t index)
 {
 	fs_node_t *fn;
-	int rc = ext4_node_get(&fn, service_id, index);
+	errno_t rc = ext4_node_get(&fn, service_id, index);
 	if (rc != EOK)
 		return rc;
