Index: uspace/srv/fs/fat/fat_idx.c
===================================================================
--- uspace/srv/fs/fat/fat_idx.c	(revision 19f857a3b361739b06d4f547174ae4ac1b99c651)
+++ uspace/srv/fs/fat/fat_idx.c	(revision aae339e98e25549672464c38213bce673bbd21e2)
@@ -58,5 +58,5 @@
 typedef struct {
 	link_t		link;
-	dev_handle_t	dev_handle;
+	devmap_handle_t	devmap_handle;
 
 	/** Next unassigned index. */
@@ -75,8 +75,8 @@
 static LIST_INITIALIZE(unused_head);
 
-static void unused_initialize(unused_t *u, dev_handle_t dev_handle)
+static void unused_initialize(unused_t *u, devmap_handle_t devmap_handle)
 {
 	link_initialize(&u->link);
-	u->dev_handle = dev_handle;
+	u->devmap_handle = devmap_handle;
 	u->next = 0;
 	u->remaining = ((uint64_t)((fs_index_t)-1)) + 1;
@@ -84,5 +84,5 @@
 }
 
-static unused_t *unused_find(dev_handle_t dev_handle, bool lock)
+static unused_t *unused_find(devmap_handle_t devmap_handle, bool lock)
 {
 	unused_t *u;
@@ -93,5 +93,5 @@
 	for (l = unused_head.next; l != &unused_head; l = l->next) {
 		u = list_get_instance(l, unused_t, link);
-		if (u->dev_handle == dev_handle) 
+		if (u->devmap_handle == devmap_handle) 
 			return u;
 	}
@@ -106,5 +106,5 @@
 /**
  * Global hash table of all used fat_idx_t structures.
- * The index structures are hashed by the dev_handle, parent node's first
+ * The index structures are hashed by the devmap_handle, parent node's first
  * cluster and index within the parent directory.
  */ 
@@ -120,5 +120,5 @@
 static hash_index_t pos_hash(unsigned long key[])
 {
-	dev_handle_t dev_handle = (dev_handle_t)key[UPH_DH_KEY];
+	devmap_handle_t devmap_handle = (devmap_handle_t)key[UPH_DH_KEY];
 	fat_cluster_t pfc = (fat_cluster_t)key[UPH_PFC_KEY];
 	unsigned pdi = (unsigned)key[UPH_PDI_KEY];
@@ -140,5 +140,5 @@
 	h |= (pdi & ((1 << (UPH_BUCKETS_LOG / 4)) - 1)) <<
 	    (UPH_BUCKETS_LOG / 2); 
-	h |= (dev_handle & ((1 << (UPH_BUCKETS_LOG / 4)) - 1)) <<
+	h |= (devmap_handle & ((1 << (UPH_BUCKETS_LOG / 4)) - 1)) <<
 	    (3 * (UPH_BUCKETS_LOG / 4));
 
@@ -148,5 +148,5 @@
 static int pos_compare(unsigned long key[], hash_count_t keys, link_t *item)
 {
-	dev_handle_t dev_handle = (dev_handle_t)key[UPH_DH_KEY];
+	devmap_handle_t devmap_handle = (devmap_handle_t)key[UPH_DH_KEY];
 	fat_cluster_t pfc;
 	unsigned pdi;
@@ -155,9 +155,9 @@
 	switch (keys) {
 	case 1:
-		return (dev_handle == fidx->dev_handle);
+		return (devmap_handle == fidx->devmap_handle);
 	case 3:
 		pfc = (fat_cluster_t) key[UPH_PFC_KEY];
 		pdi = (unsigned) key[UPH_PDI_KEY];
-		return (dev_handle == fidx->dev_handle) && (pfc == fidx->pfc) &&
+		return (devmap_handle == fidx->devmap_handle) && (pfc == fidx->pfc) &&
 		    (pdi == fidx->pdi);
 	default:
@@ -181,5 +181,5 @@
 /**
  * Global hash table of all used fat_idx_t structures.
- * The index structures are hashed by the dev_handle and index.
+ * The index structures are hashed by the devmap_handle and index.
  */
 static hash_table_t ui_hash;
@@ -193,10 +193,10 @@
 static hash_index_t idx_hash(unsigned long key[])
 {
-	dev_handle_t dev_handle = (dev_handle_t)key[UIH_DH_KEY];
+	devmap_handle_t devmap_handle = (devmap_handle_t)key[UIH_DH_KEY];
 	fs_index_t index = (fs_index_t)key[UIH_INDEX_KEY];
 
 	hash_index_t h;
 
-	h = dev_handle & ((1 << (UIH_BUCKETS_LOG / 2)) - 1);
+	h = devmap_handle & ((1 << (UIH_BUCKETS_LOG / 2)) - 1);
 	h |= (index & ((1 << (UIH_BUCKETS_LOG / 2)) - 1)) <<
 	    (UIH_BUCKETS_LOG / 2);
@@ -207,5 +207,5 @@
 static int idx_compare(unsigned long key[], hash_count_t keys, link_t *item)
 {
-	dev_handle_t dev_handle = (dev_handle_t)key[UIH_DH_KEY];
+	devmap_handle_t devmap_handle = (devmap_handle_t)key[UIH_DH_KEY];
 	fs_index_t index;
 	fat_idx_t *fidx = list_get_instance(item, fat_idx_t, uih_link);
@@ -213,8 +213,8 @@
 	switch (keys) {
 	case 1:
-		return (dev_handle == fidx->dev_handle);
+		return (devmap_handle == fidx->devmap_handle);
 	case 2:
 		index = (fs_index_t) key[UIH_INDEX_KEY];
-		return (dev_handle == fidx->dev_handle) &&
+		return (devmap_handle == fidx->devmap_handle) &&
 		    (index == fidx->index);
 	default:
@@ -239,10 +239,10 @@
 
 /** Allocate a VFS index which is not currently in use. */
-static bool fat_index_alloc(dev_handle_t dev_handle, fs_index_t *index)
+static bool fat_index_alloc(devmap_handle_t devmap_handle, fs_index_t *index)
 {
 	unused_t *u;
 	
 	assert(index);
-	u = unused_find(dev_handle, true);
+	u = unused_find(devmap_handle, true);
 	if (!u)
 		return false;	
@@ -301,9 +301,9 @@
 
 /** Free a VFS index, which is no longer in use. */
-static void fat_index_free(dev_handle_t dev_handle, fs_index_t index)
+static void fat_index_free(devmap_handle_t devmap_handle, fs_index_t index)
 {
 	unused_t *u;
 
-	u = unused_find(dev_handle, true);
+	u = unused_find(devmap_handle, true);
 	assert(u);
 
@@ -363,5 +363,5 @@
 }
 
-static int fat_idx_create(fat_idx_t **fidxp, dev_handle_t dev_handle)
+static int fat_idx_create(fat_idx_t **fidxp, devmap_handle_t devmap_handle)
 {
 	fat_idx_t *fidx;
@@ -370,5 +370,5 @@
 	if (!fidx) 
 		return ENOMEM;
-	if (!fat_index_alloc(dev_handle, &fidx->index)) {
+	if (!fat_index_alloc(devmap_handle, &fidx->index)) {
 		free(fidx);
 		return ENOSPC;
@@ -378,5 +378,5 @@
 	link_initialize(&fidx->uih_link);
 	fibril_mutex_initialize(&fidx->lock);
-	fidx->dev_handle = dev_handle;
+	fidx->devmap_handle = devmap_handle;
 	fidx->pfc = FAT_CLST_RES0;	/* no parent yet */
 	fidx->pdi = 0;
@@ -387,5 +387,5 @@
 }
 
-int fat_idx_get_new(fat_idx_t **fidxp, dev_handle_t dev_handle)
+int fat_idx_get_new(fat_idx_t **fidxp, devmap_handle_t devmap_handle)
 {
 	fat_idx_t *fidx;
@@ -393,5 +393,5 @@
 
 	fibril_mutex_lock(&used_lock);
-	rc = fat_idx_create(&fidx, dev_handle);
+	rc = fat_idx_create(&fidx, devmap_handle);
 	if (rc != EOK) {
 		fibril_mutex_unlock(&used_lock);
@@ -400,5 +400,5 @@
 		
 	unsigned long ikey[] = {
-		[UIH_DH_KEY] = dev_handle,
+		[UIH_DH_KEY] = devmap_handle,
 		[UIH_INDEX_KEY] = fidx->index,
 	};
@@ -413,10 +413,10 @@
 
 fat_idx_t *
-fat_idx_get_by_pos(dev_handle_t dev_handle, fat_cluster_t pfc, unsigned pdi)
+fat_idx_get_by_pos(devmap_handle_t devmap_handle, fat_cluster_t pfc, unsigned pdi)
 {
 	fat_idx_t *fidx;
 	link_t *l;
 	unsigned long pkey[] = {
-		[UPH_DH_KEY] = dev_handle,
+		[UPH_DH_KEY] = devmap_handle,
 		[UPH_PFC_KEY] = pfc,
 		[UPH_PDI_KEY] = pdi,
@@ -430,5 +430,5 @@
 		int rc;
 
-		rc = fat_idx_create(&fidx, dev_handle);
+		rc = fat_idx_create(&fidx, devmap_handle);
 		if (rc != EOK) {
 			fibril_mutex_unlock(&used_lock);
@@ -437,5 +437,5 @@
 		
 		unsigned long ikey[] = {
-			[UIH_DH_KEY] = dev_handle,
+			[UIH_DH_KEY] = devmap_handle,
 			[UIH_INDEX_KEY] = fidx->index,
 		};
@@ -456,5 +456,5 @@
 {
 	unsigned long pkey[] = {
-		[UPH_DH_KEY] = idx->dev_handle,
+		[UPH_DH_KEY] = idx->devmap_handle,
 		[UPH_PFC_KEY] = idx->pfc,
 		[UPH_PDI_KEY] = idx->pdi,
@@ -469,5 +469,5 @@
 {
 	unsigned long pkey[] = {
-		[UPH_DH_KEY] = idx->dev_handle,
+		[UPH_DH_KEY] = idx->devmap_handle,
 		[UPH_PFC_KEY] = idx->pfc,
 		[UPH_PDI_KEY] = idx->pdi,
@@ -480,10 +480,10 @@
 
 fat_idx_t *
-fat_idx_get_by_index(dev_handle_t dev_handle, fs_index_t index)
+fat_idx_get_by_index(devmap_handle_t devmap_handle, fs_index_t index)
 {
 	fat_idx_t *fidx = NULL;
 	link_t *l;
 	unsigned long ikey[] = {
-		[UIH_DH_KEY] = dev_handle,
+		[UIH_DH_KEY] = devmap_handle,
 		[UIH_INDEX_KEY] = index,
 	};
@@ -507,8 +507,8 @@
 {
 	unsigned long ikey[] = {
-		[UIH_DH_KEY] = idx->dev_handle,
+		[UIH_DH_KEY] = idx->devmap_handle,
 		[UIH_INDEX_KEY] = idx->index,
 	};
-	dev_handle_t dev_handle = idx->dev_handle;
+	devmap_handle_t devmap_handle = idx->devmap_handle;
 	fs_index_t index = idx->index;
 
@@ -524,5 +524,5 @@
 	fibril_mutex_unlock(&used_lock);
 	/* Release the VFS index. */
-	fat_index_free(dev_handle, index);
+	fat_index_free(devmap_handle, index);
 	/* The index structure itself is freed in idx_remove_callback(). */
 }
@@ -546,5 +546,5 @@
 }
 
-int fat_idx_init_by_dev_handle(dev_handle_t dev_handle)
+int fat_idx_init_by_devmap_handle(devmap_handle_t devmap_handle)
 {
 	unused_t *u;
@@ -554,7 +554,7 @@
 	if (!u)
 		return ENOMEM;
-	unused_initialize(u, dev_handle);
+	unused_initialize(u, devmap_handle);
 	fibril_mutex_lock(&unused_lock);
-	if (!unused_find(dev_handle, false)) {
+	if (!unused_find(devmap_handle, false)) {
 		list_append(&u->link, &unused_head);
 	} else {
@@ -566,11 +566,11 @@
 }
 
-void fat_idx_fini_by_dev_handle(dev_handle_t dev_handle)
+void fat_idx_fini_by_devmap_handle(devmap_handle_t devmap_handle)
 {
 	unsigned long ikey[] = {
-		[UIH_DH_KEY] = dev_handle
+		[UIH_DH_KEY] = devmap_handle
 	};
 	unsigned long pkey[] = {
-		[UPH_DH_KEY] = dev_handle
+		[UPH_DH_KEY] = devmap_handle
 	};
 
@@ -588,5 +588,5 @@
 	 * Free the unused and freed structures for this instance.
 	 */
-	unused_t *u = unused_find(dev_handle, true);
+	unused_t *u = unused_find(devmap_handle, true);
 	assert(u);
 	list_remove(&u->link);
