Index: uspace/srv/fs/fat/fat_idx.c
===================================================================
--- uspace/srv/fs/fat/fat_idx.c	(revision d9c8c81f21850cb9e08890ce3919e1d8e253e810)
+++ uspace/srv/fs/fat/fat_idx.c	(revision 4e1b57de0f1631729b8907befb57c677fd2d06d4)
@@ -43,5 +43,5 @@
 #include <adt/list.h>
 #include <assert.h>
-#include <futex.h>
+#include <fibril_sync.h>
 
 /** Each instance of this type describes one interval of freed VFS indices. */
@@ -69,6 +69,6 @@
 } unused_t;
 
-/** Futex protecting the list of unused structures. */
-static futex_t unused_futex = FUTEX_INITIALIZER;
+/** Mutex protecting the list of unused structures. */
+static FIBRIL_MUTEX_INITIALIZE(unused_lock);
 
 /** List of unused structures. */
@@ -90,5 +90,5 @@
 
 	if (lock)
-		futex_down(&unused_futex);
+		fibril_mutex_lock(&unused_lock);
 	for (l = unused_head.next; l != &unused_head; l = l->next) {
 		u = list_get_instance(l, unused_t, link);
@@ -97,10 +97,10 @@
 	}
 	if (lock)
-		futex_up(&unused_futex);
+		fibril_mutex_unlock(&unused_lock);
 	return NULL;
 }
 
-/** Futex protecting the up_hash and ui_hash. */
-static futex_t used_futex = FUTEX_INITIALIZER; 
+/** Mutex protecting the up_hash and ui_hash. */
+static FIBRIL_MUTEX_INITIALIZE(used_lock);
 
 /**
@@ -232,5 +232,5 @@
 			*index = u->next++;
 			--u->remaining;
-			futex_up(&unused_futex);
+			fibril_mutex_unlock(&unused_lock);
 			return true;
 		}
@@ -245,5 +245,5 @@
 			free(f);
 		}
-		futex_up(&unused_futex);
+		fibril_mutex_unlock(&unused_lock);
 		return true;
 	}
@@ -253,5 +253,5 @@
 	 * too many zero-sized nodes).
 	 */
-	futex_up(&unused_futex);
+	fibril_mutex_unlock(&unused_lock);
 	return false;
 }
@@ -303,5 +303,5 @@
 					try_coalesce_intervals(lnk->prev, lnk,
 					    lnk);
-				futex_up(&unused_futex);
+				fibril_mutex_unlock(&unused_lock);
 				return;
 			}
@@ -311,5 +311,5 @@
 					try_coalesce_intervals(lnk, lnk->next,
 					    lnk);
-				futex_up(&unused_futex);
+				fibril_mutex_unlock(&unused_lock);
 				return;
 			}
@@ -322,5 +322,5 @@
 				n->last = index;
 				list_insert_before(&n->link, lnk);
-				futex_up(&unused_futex);
+				fibril_mutex_unlock(&unused_lock);
 				return;
 			}
@@ -336,5 +336,5 @@
 		list_append(&n->link, &u->freed_head);
 	}
-	futex_up(&unused_futex);
+	fibril_mutex_unlock(&unused_lock);
 }
 
@@ -353,5 +353,5 @@
 	link_initialize(&fidx->uph_link);
 	link_initialize(&fidx->uih_link);
-	futex_initialize(&fidx->lock, 1);
+	fibril_mutex_initialize(&fidx->lock);
 	fidx->dev_handle = dev_handle;
 	fidx->pfc = FAT_CLST_RES0;	/* no parent yet */
@@ -366,8 +366,8 @@
 	fat_idx_t *fidx;
 
-	futex_down(&used_futex);
+	fibril_mutex_lock(&used_lock);
 	fidx = fat_idx_create(dev_handle);
 	if (!fidx) {
-		futex_up(&used_futex);
+		fibril_mutex_unlock(&used_lock);
 		return NULL;
 	}
@@ -379,6 +379,6 @@
 	
 	hash_table_insert(&ui_hash, ikey, &fidx->uih_link);
-	futex_down(&fidx->lock);
-	futex_up(&used_futex);
+	fibril_mutex_lock(&fidx->lock);
+	fibril_mutex_unlock(&used_lock);
 
 	return fidx;
@@ -396,5 +396,5 @@
 	};
 
-	futex_down(&used_futex);
+	fibril_mutex_lock(&used_lock);
 	l = hash_table_find(&up_hash, pkey);
 	if (l) {
@@ -403,5 +403,5 @@
 		fidx = fat_idx_create(dev_handle);
 		if (!fidx) {
-			futex_up(&used_futex);
+			fibril_mutex_unlock(&used_lock);
 			return NULL;
 		}
@@ -418,6 +418,6 @@
 		hash_table_insert(&ui_hash, ikey, &fidx->uih_link);
 	}
-	futex_down(&fidx->lock);
-	futex_up(&used_futex);
+	fibril_mutex_lock(&fidx->lock);
+	fibril_mutex_unlock(&used_lock);
 
 	return fidx;
@@ -432,7 +432,7 @@
 	};
 
-	futex_down(&used_futex);
+	fibril_mutex_lock(&used_lock);
 	hash_table_insert(&up_hash, pkey, &idx->uph_link);
-	futex_up(&used_futex);
+	fibril_mutex_unlock(&used_lock);
 }
 
@@ -445,7 +445,7 @@
 	};
 
-	futex_down(&used_futex);
+	fibril_mutex_lock(&used_lock);
 	hash_table_remove(&up_hash, pkey, 3);
-	futex_up(&used_futex);
+	fibril_mutex_unlock(&used_lock);
 }
 
@@ -460,5 +460,5 @@
 	};
 
-	futex_down(&used_futex);
+	fibril_mutex_lock(&used_lock);
 	l = hash_table_find(&ui_hash, ikey);
 	if (l) {
@@ -466,5 +466,5 @@
 		futex_down(&fidx->lock);
 	}
-	futex_up(&used_futex);
+	fibril_mutex_unlock(&used_lock);
 
 	return fidx;
@@ -484,5 +484,5 @@
 	assert(idx->pfc == FAT_CLST_RES0);
 
-	futex_down(&used_futex);
+	fibril_mutex_lock(&used_lock);
 	/*
 	 * Since we can only free unlinked nodes, the index structure is not
@@ -491,5 +491,5 @@
 	 */
 	hash_table_remove(&ui_hash, ikey, 2);
-	futex_up(&used_futex);
+	fibril_mutex_unlock(&used_lock);
 	/* Release the VFS index. */
 	fat_index_free(idx->dev_handle, idx->index);
@@ -525,10 +525,10 @@
 		return ENOMEM;
 	unused_initialize(u, dev_handle);
-	futex_down(&unused_futex);
+	fibril_mutex_lock(&unused_lock);
 	if (!unused_find(dev_handle, false))
 		list_append(&u->link, &unused_head);
 	else
 		rc = EEXIST;
-	futex_up(&unused_futex);
+	fibril_mutex_unlock(&unused_lock);
 	return rc;
 }
@@ -541,5 +541,5 @@
 	assert(u);
 	list_remove(&u->link);
-	futex_up(&unused_futex);
+	fibril_mutex_unlock(&unused_lock);
 
 	while (!list_empty(&u->freed_head)) {
