Index: uspace/srv/fs/fat/fat.h
===================================================================
--- uspace/srv/fs/fat/fat.h	(revision 34ca87020c63e556aea19a44031baae2f32014b4)
+++ uspace/srv/fs/fat/fat.h	(revision 6ebe72166e34f2b3734f6630c9ca7d45806c9826)
@@ -36,4 +36,5 @@
 #include "fat_fat.h"
 #include <ipc/ipc.h>
+#include <fibril_sync.h>
 #include <libfs.h>
 #include <atomic.h>
@@ -161,5 +162,5 @@
 	link_t		uih_link;
 
-	futex_t		lock;
+	fibril_mutex_t	lock;
 	dev_handle_t	dev_handle;
 	fs_index_t	index;
@@ -182,5 +183,5 @@
 	fs_node_t		*bp;
 	
-	futex_t			lock;
+	fibril_mutex_t		lock;
 	fat_node_type_t		type;
 	fat_idx_t		*idx;
Index: uspace/srv/fs/fat/fat_fat.c
===================================================================
--- uspace/srv/fs/fat/fat_fat.c	(revision 34ca87020c63e556aea19a44031baae2f32014b4)
+++ uspace/srv/fs/fat/fat_fat.c	(revision 6ebe72166e34f2b3734f6630c9ca7d45806c9826)
@@ -46,13 +46,13 @@
 #include <align.h>
 #include <assert.h>
-#include <futex.h>
+#include <fibril_sync.h>
 #include <mem.h>
 
 /**
- * The fat_alloc_lock futex protects all copies of the File Allocation Table
+ * The fat_alloc_lock mutex protects all copies of the File Allocation Table
  * during allocation of clusters. The lock does not have to be held durring
  * deallocation of clusters.
  */  
-static futex_t fat_alloc_lock = FUTEX_INITIALIZER;
+static FIBRIL_MUTEX_INITIALIZE(fat_alloc_lock);
 
 /** Walk the cluster chain.
@@ -327,5 +327,5 @@
 	 * Search FAT1 for unused clusters.
 	 */
-	futex_down(&fat_alloc_lock);
+	fibril_mutex_lock(&fat_alloc_lock);
 	for (b = 0, cl = 0; b < sf; b++) {
 		blk = block_get(dev_handle, rscnt + b, BLOCK_FLAGS_NONE);
@@ -351,5 +351,5 @@
 					*lcl = lifo[0];
 					free(lifo);
-					futex_up(&fat_alloc_lock);
+					fibril_mutex_unlock(&fat_alloc_lock);
 					return EOK;
 				}
@@ -358,5 +358,5 @@
 		block_put(blk);
 	}
-	futex_up(&fat_alloc_lock);
+	fibril_mutex_unlock(&fat_alloc_lock);
 
 	/*
Index: uspace/srv/fs/fat/fat_idx.c
===================================================================
--- uspace/srv/fs/fat/fat_idx.c	(revision 34ca87020c63e556aea19a44031baae2f32014b4)
+++ uspace/srv/fs/fat/fat_idx.c	(revision 6ebe72166e34f2b3734f6630c9ca7d45806c9826)
@@ -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)) {
Index: uspace/srv/fs/fat/fat_ops.c
===================================================================
--- uspace/srv/fs/fat/fat_ops.c	(revision 34ca87020c63e556aea19a44031baae2f32014b4)
+++ uspace/srv/fs/fat/fat_ops.c	(revision 6ebe72166e34f2b3734f6630c9ca7d45806c9826)
@@ -52,5 +52,5 @@
 #include <adt/list.h>
 #include <assert.h>
-#include <futex.h>
+#include <fibril_sync.h>
 #include <sys/mman.h>
 #include <align.h>
@@ -59,6 +59,6 @@
 #define FS_NODE(node)	((node) ? (node)->bp : NULL)
 
-/** Futex protecting the list of cached free FAT nodes. */
-static futex_t ffn_futex = FUTEX_INITIALIZER;
+/** Mutex protecting the list of cached free FAT nodes. */
+static FIBRIL_MUTEX_INITIALIZE(ffn_mutex);
 
 /** List of cached free FAT nodes. */
@@ -67,5 +67,5 @@
 static void fat_node_initialize(fat_node_t *node)
 {
-	futex_initialize(&node->lock, 1);
+	fibril_mutex_initialize(&node->lock);
 	node->bp = NULL;
 	node->idx = NULL;
@@ -116,28 +116,28 @@
 	fat_node_t *nodep;
 
-	futex_down(&ffn_futex);
+	fibril_mutex_lock(&ffn_mutex);
 	if (!list_empty(&ffn_head)) {
 		/* Try to use a cached free node structure. */
 		fat_idx_t *idxp_tmp;
 		nodep = list_get_instance(ffn_head.next, fat_node_t, ffn_link);
-		if (futex_trydown(&nodep->lock) == ESYNCH_WOULD_BLOCK)
+		if (!fibril_mutex_trylock(&nodep->lock))
 			goto skip_cache;
 		idxp_tmp = nodep->idx;
-		if (futex_trydown(&idxp_tmp->lock) == ESYNCH_WOULD_BLOCK) {
-			futex_up(&nodep->lock);
+		if (!fibril_mutex_trylock(&idxp_tmp->lock)) {
+			fibril_mutex_unlock(&nodep->lock);
 			goto skip_cache;
 		}
 		list_remove(&nodep->ffn_link);
-		futex_up(&ffn_futex);
+		fibril_mutex_unlock(&ffn_mutex);
 		if (nodep->dirty)
 			fat_node_sync(nodep);
 		idxp_tmp->nodep = NULL;
-		futex_up(&nodep->lock);
-		futex_up(&idxp_tmp->lock);
+		fibril_mutex_unlock(&nodep->lock);
+		fibril_mutex_unlock(&idxp_tmp->lock);
 		fn = FS_NODE(nodep);
 	} else {
 skip_cache:
 		/* Try to allocate a new node structure. */
-		futex_up(&ffn_futex);
+		fibril_mutex_unlock(&ffn_mutex);
 		fn = (fs_node_t *)malloc(sizeof(fs_node_t));
 		if (!fn)
@@ -176,8 +176,8 @@
 		 * The node is already instantiated in memory.
 		 */
-		futex_down(&idxp->nodep->lock);
+		fibril_mutex_lock(&idxp->nodep->lock);
 		if (!idxp->nodep->refcnt++)
 			list_remove(&idxp->nodep->ffn_link);
-		futex_up(&idxp->nodep->lock);
+		fibril_mutex_unlock(&idxp->nodep->lock);
 		return idxp->nodep;
 	}
@@ -269,5 +269,5 @@
 	/* idxp->lock held */
 	nodep = fat_node_get_core(idxp);
-	futex_up(&idxp->lock);
+	fibril_mutex_unlock(&idxp->lock);
 	return FS_NODE(nodep);
 }
@@ -278,10 +278,10 @@
 	bool destroy = false;
 
-	futex_down(&nodep->lock);
+	fibril_mutex_lock(&nodep->lock);
 	if (!--nodep->refcnt) {
 		if (nodep->idx) {
-			futex_down(&ffn_futex);
+			fibril_mutex_lock(&ffn_mutex);
 			list_append(&nodep->ffn_link, &ffn_head);
-			futex_up(&ffn_futex);
+			fibril_mutex_unlock(&ffn_mutex);
 		} else {
 			/*
@@ -294,5 +294,5 @@
 		}
 	}
-	futex_up(&nodep->lock);
+	fibril_mutex_unlock(&nodep->lock);
 	if (destroy) {
 		free(nodep->bp);
@@ -361,5 +361,5 @@
 	idxp->nodep = nodep;
 
-	futex_up(&idxp->lock);
+	fibril_mutex_unlock(&idxp->lock);
 	return FS_NODE(nodep);
 }
@@ -410,14 +410,14 @@
 	int rc;
 
-	futex_down(&childp->lock);
+	fibril_mutex_lock(&childp->lock);
 	if (childp->lnkcnt == 1) {
 		/*
 		 * On FAT, we don't support multiple hard links.
 		 */
-		futex_up(&childp->lock);
+		fibril_mutex_unlock(&childp->lock);
 		return EMLINK;
 	}
 	assert(childp->lnkcnt == 0);
-	futex_up(&childp->lock);
+	fibril_mutex_unlock(&childp->lock);
 
 	if (!fat_dentry_name_verify(name)) {
@@ -433,5 +433,5 @@
 	 */
 	
-	futex_down(&parentp->idx->lock);
+	fibril_mutex_lock(&parentp->idx->lock);
 	bs = block_bb_get(parentp->idx->dev_handle);
 	bps = uint16_t_le2host(bs->bps);
@@ -464,10 +464,10 @@
 	if (parentp->idx->pfc == FAT_CLST_ROOT) {
 		/* Can't grow the root directory. */
-		futex_up(&parentp->idx->lock);
+		fibril_mutex_unlock(&parentp->idx->lock);
 		return ENOSPC;
 	}
 	rc = fat_alloc_clusters(bs, parentp->idx->dev_handle, 1, &mcl, &lcl);
 	if (rc != EOK) {
-		futex_up(&parentp->idx->lock);
+		fibril_mutex_unlock(&parentp->idx->lock);
 		return rc;
 	}
@@ -492,7 +492,7 @@
 	b->dirty = true;		/* need to sync block */
 	block_put(b);
-	futex_up(&parentp->idx->lock);
-
-	futex_down(&childp->idx->lock);
+	fibril_mutex_unlock(&parentp->idx->lock);
+
+	fibril_mutex_lock(&childp->idx->lock);
 	
 	/*
@@ -530,10 +530,10 @@
 	childp->idx->pfc = parentp->firstc;
 	childp->idx->pdi = i * dps + j;
-	futex_up(&childp->idx->lock);
-
-	futex_down(&childp->lock);
+	fibril_mutex_unlock(&childp->idx->lock);
+
+	fibril_mutex_lock(&childp->lock);
 	childp->lnkcnt = 1;
 	childp->dirty = true;		/* need to sync node */
-	futex_up(&childp->lock);
+	fibril_mutex_unlock(&childp->lock);
 
 	/*
@@ -560,8 +560,8 @@
 		return ENOTEMPTY;
 
-	futex_down(&parentp->lock);
-	futex_down(&childp->lock);
+	fibril_mutex_lock(&parentp->lock);
+	fibril_mutex_lock(&childp->lock);
 	assert(childp->lnkcnt == 1);
-	futex_down(&childp->idx->lock);
+	fibril_mutex_lock(&childp->idx->lock);
 	bs = block_bb_get(childp->idx->dev_handle);
 	bps = uint16_t_le2host(bs->bps);
@@ -582,9 +582,9 @@
 	childp->idx->pfc = FAT_CLST_RES0;
 	childp->idx->pdi = 0;
-	futex_up(&childp->idx->lock);
+	fibril_mutex_unlock(&childp->idx->lock);
 	childp->lnkcnt = 0;
 	childp->dirty = true;
-	futex_up(&childp->lock);
-	futex_up(&parentp->lock);
+	fibril_mutex_unlock(&childp->lock);
+	fibril_mutex_unlock(&parentp->lock);
 
 	return EOK;
@@ -603,5 +603,5 @@
 	block_t *b;
 
-	futex_down(&parentp->idx->lock);
+	fibril_mutex_lock(&parentp->idx->lock);
 	bs = block_bb_get(parentp->idx->dev_handle);
 	bps = uint16_t_le2host(bs->bps);
@@ -618,5 +618,5 @@
 			case FAT_DENTRY_LAST:
 				block_put(b);
-				futex_up(&parentp->idx->lock);
+				fibril_mutex_unlock(&parentp->idx->lock);
 				return NULL;
 			default:
@@ -637,5 +637,5 @@
 				    parentp->idx->dev_handle, parentp->firstc,
 				    i * dps + j);
-				futex_up(&parentp->idx->lock);
+				fibril_mutex_unlock(&parentp->idx->lock);
 				if (!idx) {
 					/*
@@ -647,5 +647,5 @@
 				}
 				nodep = fat_node_get_core(idx);
-				futex_up(&idx->lock);
+				fibril_mutex_unlock(&idx->lock);
 				block_put(b);
 				return FS_NODE(nodep);
@@ -655,5 +655,5 @@
 	}
 
-	futex_up(&parentp->idx->lock);
+	fibril_mutex_unlock(&parentp->idx->lock);
 	return NULL;
 }
@@ -687,5 +687,5 @@
 		return false;
 	
-	futex_down(&nodep->idx->lock);
+	fibril_mutex_lock(&nodep->idx->lock);
 	bs = block_bb_get(nodep->idx->dev_handle);
 	bps = uint16_t_le2host(bs->bps);
@@ -706,14 +706,14 @@
 			case FAT_DENTRY_LAST:
 				block_put(b);
-				futex_up(&nodep->idx->lock);
+				fibril_mutex_unlock(&nodep->idx->lock);
 				return false;
 			default:
 			case FAT_DENTRY_VALID:
 				block_put(b);
-				futex_up(&nodep->idx->lock);
+				fibril_mutex_unlock(&nodep->idx->lock);
 				return true;
 			}
 			block_put(b);
-			futex_up(&nodep->idx->lock);
+			fibril_mutex_unlock(&nodep->idx->lock);
 			return true;
 		}
@@ -721,5 +721,5 @@
 	}
 
-	futex_up(&nodep->idx->lock);
+	fibril_mutex_unlock(&nodep->idx->lock);
 	return false;
 }
@@ -882,5 +882,5 @@
 	rfn->data = rootp;
 	
-	futex_up(&ridxp->lock);
+	fibril_mutex_unlock(&ridxp->lock);
 
 	ipc_answer_3(rid, EOK, ridxp->index, rootp->size, rootp->lnkcnt);
