Index: uspace/srv/fs/fat/fat_fat.c
===================================================================
--- uspace/srv/fs/fat/fat_fat.c	(revision c7bbf029477192dc16abf12a6c8de1c3181d7867)
+++ uspace/srv/fs/fat/fat_fat.c	(revision bd5f3b795b75802e7f957c9589605a904f7667df)
@@ -71,5 +71,5 @@
  *
  * @param bs		Buffer holding the boot sector for the file.
- * @param devmap_handle	Device handle of the device with the file.
+ * @param service_id	Service ID of the device with the file.
  * @param firstc	First cluster to start the walk with.
  * @param lastc		If non-NULL, output argument hodling the last cluster
@@ -82,5 +82,5 @@
  */
 int 
-fat_cluster_walk(fat_bs_t *bs, devmap_handle_t devmap_handle, fat_cluster_t firstc,
+fat_cluster_walk(fat_bs_t *bs, service_id_t service_id, fat_cluster_t firstc,
     fat_cluster_t *lastc, uint16_t *numc, uint16_t max_clusters)
 {
@@ -109,5 +109,5 @@
 		fidx = clst % (BPS(bs) / sizeof(fat_cluster_t));
 		/* read FAT1 */
-		rc = block_get(&b, devmap_handle, RSCNT(bs) + fsec,
+		rc = block_get(&b, service_id, RSCNT(bs) + fsec,
 		    BLOCK_FLAGS_NONE);
 		if (rc != EOK)
@@ -160,5 +160,5 @@
 		 * when fortunately we have the last cluster number cached.
 		 */
-		return block_get(block, nodep->idx->devmap_handle,
+		return block_get(block, nodep->idx->service_id,
 		    CLBN2PBN(bs, nodep->lastc_cached_value, bn), flags);
 	}
@@ -174,5 +174,5 @@
 
 fall_through:
-	rc = _fat_block_get(block, bs, nodep->idx->devmap_handle, firstc,
+	rc = _fat_block_get(block, bs, nodep->idx->service_id, firstc,
 	    &currc, relbn, flags);
 	if (rc != EOK)
@@ -193,5 +193,5 @@
  * @param block		Pointer to a block pointer for storing result.
  * @param bs		Buffer holding the boot sector of the file system.
- * @param devmap_handle	Device handle of the file system.
+ * @param service_id	Service ID handle of the file system.
  * @param fcl		First cluster used by the file. Can be zero if the file
  *			is empty.
@@ -205,5 +205,5 @@
  */
 int
-_fat_block_get(block_t **block, fat_bs_t *bs, devmap_handle_t devmap_handle,
+_fat_block_get(block_t **block, fat_bs_t *bs, service_id_t service_id,
     fat_cluster_t fcl, fat_cluster_t *clp, aoff64_t bn, int flags)
 {
@@ -222,5 +222,5 @@
 		/* root directory special case */
 		assert(bn < RDS(bs));
-		rc = block_get(block, devmap_handle,
+		rc = block_get(block, service_id,
 		    RSCNT(bs) + FATCNT(bs) * SF(bs) + bn, flags);
 		return rc;
@@ -228,10 +228,10 @@
 
 	max_clusters = bn / SPC(bs);
-	rc = fat_cluster_walk(bs, devmap_handle, fcl, &c, &clusters, max_clusters);
+	rc = fat_cluster_walk(bs, service_id, fcl, &c, &clusters, max_clusters);
 	if (rc != EOK)
 		return rc;
 	assert(clusters == max_clusters);
 
-	rc = block_get(block, devmap_handle, CLBN2PBN(bs, c, bn), flags);
+	rc = block_get(block, service_id, CLBN2PBN(bs, c, bn), flags);
 
 	if (clp)
@@ -281,5 +281,5 @@
 	/* zero out the initial part of the new cluster chain */
 	for (o = boundary; o < pos; o += BPS(bs)) {
-		rc = _fat_block_get(&b, bs, nodep->idx->devmap_handle, mcl,
+		rc = _fat_block_get(&b, bs, nodep->idx->service_id, mcl,
 		    NULL, (o - boundary) / BPS(bs), BLOCK_FLAGS_NOREAD);
 		if (rc != EOK)
@@ -298,5 +298,5 @@
  *
  * @param bs		Buffer holding the boot sector for the file system.
- * @param devmap_handle	Device handle for the file system.
+ * @param service_id	Service ID for the file system.
  * @param clst		Cluster which to get.
  * @param value		Output argument holding the value of the cluster.
@@ -305,5 +305,5 @@
  */
 int
-fat_get_cluster(fat_bs_t *bs, devmap_handle_t devmap_handle, unsigned fatno,
+fat_get_cluster(fat_bs_t *bs, service_id_t service_id, unsigned fatno,
     fat_cluster_t clst, fat_cluster_t *value)
 {
@@ -312,5 +312,5 @@
 	int rc;
 
-	rc = block_get(&b, devmap_handle, RSCNT(bs) + SF(bs) * fatno +
+	rc = block_get(&b, service_id, RSCNT(bs) + SF(bs) * fatno +
 	    (clst * sizeof(fat_cluster_t)) / BPS(bs), BLOCK_FLAGS_NONE);
 	if (rc != EOK)
@@ -327,5 +327,5 @@
  *
  * @param bs		Buffer holding the boot sector for the file system.
- * @param devmap_handle	Device handle for the file system.
+ * @param service_id	Device service ID for the file system.
  * @param fatno		Number of the FAT instance where to make the change.
  * @param clst		Cluster which is to be set.
@@ -335,5 +335,5 @@
  */
 int
-fat_set_cluster(fat_bs_t *bs, devmap_handle_t devmap_handle, unsigned fatno,
+fat_set_cluster(fat_bs_t *bs, service_id_t service_id, unsigned fatno,
     fat_cluster_t clst, fat_cluster_t value)
 {
@@ -343,5 +343,5 @@
 
 	assert(fatno < FATCNT(bs));
-	rc = block_get(&b, devmap_handle, RSCNT(bs) + SF(bs) * fatno +
+	rc = block_get(&b, service_id, RSCNT(bs) + SF(bs) * fatno +
 	    (clst * sizeof(fat_cluster_t)) / BPS(bs), BLOCK_FLAGS_NONE);
 	if (rc != EOK)
@@ -358,5 +358,5 @@
  *
  * @param bs		Buffer holding the boot sector of the file system.
- * @param devmap_handle	Device handle of the file system.
+ * @param service_id	Service ID of the file system.
  * @param lifo		Chain of allocated clusters.
  * @param nclsts	Number of clusters in the lifo chain.
@@ -364,5 +364,5 @@
  * @return		EOK on success or a negative error code.
  */
-int fat_alloc_shadow_clusters(fat_bs_t *bs, devmap_handle_t devmap_handle,
+int fat_alloc_shadow_clusters(fat_bs_t *bs, service_id_t service_id,
     fat_cluster_t *lifo, unsigned nclsts)
 {
@@ -373,5 +373,5 @@
 	for (fatno = FAT1 + 1; fatno < bs->fatcnt; fatno++) {
 		for (c = 0; c < nclsts; c++) {
-			rc = fat_set_cluster(bs, devmap_handle, fatno, lifo[c],
+			rc = fat_set_cluster(bs, service_id, fatno, lifo[c],
 			    c == 0 ? FAT_CLST_LAST1 : lifo[c - 1]);
 			if (rc != EOK)
@@ -391,5 +391,5 @@
  *
  * @param bs		Buffer holding the boot sector of the file system.
- * @param devmap_handle	Device handle of the file system.
+ * @param service_id	Device service ID of the file system.
  * @param nclsts	Number of clusters to allocate.
  * @param mcl		Output parameter where the first cluster in the chain
@@ -401,5 +401,5 @@
  */
 int
-fat_alloc_clusters(fat_bs_t *bs, devmap_handle_t devmap_handle, unsigned nclsts,
+fat_alloc_clusters(fat_bs_t *bs, service_id_t service_id, unsigned nclsts,
     fat_cluster_t *mcl, fat_cluster_t *lcl)
 {
@@ -419,5 +419,5 @@
 	fibril_mutex_lock(&fat_alloc_lock);
 	for (b = 0, cl = 0; b < SF(bs); b++) {
-		rc = block_get(&blk, devmap_handle, RSCNT(bs) + b,
+		rc = block_get(&blk, service_id, RSCNT(bs) + b,
 		    BLOCK_FLAGS_NONE);
 		if (rc != EOK)
@@ -458,5 +458,5 @@
 					/* update the shadow copies of FAT */
 					rc = fat_alloc_shadow_clusters(bs,
-					    devmap_handle, lifo, nclsts);
+					    service_id, lifo, nclsts);
 					if (rc != EOK)
 						goto error;
@@ -485,5 +485,5 @@
 	 */
 	while (found--) {
-		rc = fat_set_cluster(bs, devmap_handle, FAT1, lifo[found],
+		rc = fat_set_cluster(bs, service_id, FAT1, lifo[found],
 		    FAT_CLST_RES0);
 		if (rc != EOK) {
@@ -500,5 +500,5 @@
  *
  * @param bs		Buffer hodling the boot sector of the file system.
- * @param devmap_handle	Device handle of the file system.
+ * @param service_id	Device service ID of the file system.
  * @param firstc	First cluster in the chain which is to be freed.
  *
@@ -506,5 +506,5 @@
  */
 int
-fat_free_clusters(fat_bs_t *bs, devmap_handle_t devmap_handle, fat_cluster_t firstc)
+fat_free_clusters(fat_bs_t *bs, service_id_t service_id, fat_cluster_t firstc)
 {
 	unsigned fatno;
@@ -515,9 +515,9 @@
 	while (firstc < FAT_CLST_LAST1) {
 		assert(firstc >= FAT_CLST_FIRST && firstc < FAT_CLST_BAD);
-		rc = fat_get_cluster(bs, devmap_handle, FAT1, firstc, &nextc);
+		rc = fat_get_cluster(bs, service_id, FAT1, firstc, &nextc);
 		if (rc != EOK)
 			return rc;
 		for (fatno = FAT1; fatno < bs->fatcnt; fatno++) {
-			rc = fat_set_cluster(bs, devmap_handle, fatno, firstc,
+			rc = fat_set_cluster(bs, service_id, fatno, firstc,
 			    FAT_CLST_RES0);
 			if (rc != EOK)
@@ -544,5 +544,5 @@
     fat_cluster_t lcl)
 {
-	devmap_handle_t devmap_handle = nodep->idx->devmap_handle;
+	service_id_t service_id = nodep->idx->service_id;
 	fat_cluster_t lastc;
 	uint8_t fatno;
@@ -558,5 +558,5 @@
 			nodep->lastc_cached_valid = false;
 		} else {
-			rc = fat_cluster_walk(bs, devmap_handle, nodep->firstc,
+			rc = fat_cluster_walk(bs, service_id, nodep->firstc,
 			    &lastc, NULL, (uint16_t) -1);
 			if (rc != EOK)
@@ -565,5 +565,5 @@
 
 		for (fatno = FAT1; fatno < bs->fatcnt; fatno++) {
-			rc = fat_set_cluster(bs, nodep->idx->devmap_handle, fatno,
+			rc = fat_set_cluster(bs, nodep->idx->service_id, fatno,
 			    lastc, mcl);
 			if (rc != EOK)
@@ -591,5 +591,5 @@
 {
 	int rc;
-	devmap_handle_t devmap_handle = nodep->idx->devmap_handle;
+	service_id_t service_id = nodep->idx->service_id;
 
 	/*
@@ -602,5 +602,5 @@
 	if (lcl == FAT_CLST_RES0) {
 		/* The node will have zero size and no clusters allocated. */
-		rc = fat_free_clusters(bs, devmap_handle, nodep->firstc);
+		rc = fat_free_clusters(bs, service_id, nodep->firstc);
 		if (rc != EOK)
 			return rc;
@@ -611,5 +611,5 @@
 		unsigned fatno;
 
-		rc = fat_get_cluster(bs, devmap_handle, FAT1, lcl, &nextc);
+		rc = fat_get_cluster(bs, service_id, FAT1, lcl, &nextc);
 		if (rc != EOK)
 			return rc;
@@ -617,5 +617,5 @@
 		/* Terminate the cluster chain in all copies of FAT. */
 		for (fatno = FAT1; fatno < bs->fatcnt; fatno++) {
-			rc = fat_set_cluster(bs, devmap_handle, fatno, lcl,
+			rc = fat_set_cluster(bs, service_id, fatno, lcl,
 			    FAT_CLST_LAST1);
 			if (rc != EOK)
@@ -624,5 +624,5 @@
 
 		/* Free all following clusters. */
-		rc = fat_free_clusters(bs, devmap_handle, nextc);
+		rc = fat_free_clusters(bs, service_id, nextc);
 		if (rc != EOK)
 			return rc;
@@ -639,5 +639,5 @@
 
 int
-fat_zero_cluster(struct fat_bs *bs, devmap_handle_t devmap_handle, fat_cluster_t c)
+fat_zero_cluster(struct fat_bs *bs, service_id_t service_id, fat_cluster_t c)
 {
 	int i;
@@ -646,5 +646,5 @@
 
 	for (i = 0; i < SPC(bs); i++) {
-		rc = _fat_block_get(&b, bs, devmap_handle, c, NULL, i,
+		rc = _fat_block_get(&b, bs, service_id, c, NULL, i,
 		    BLOCK_FLAGS_NOREAD);
 		if (rc != EOK)
@@ -666,5 +666,5 @@
  * does not contain a fat file system.
  */
-int fat_sanity_check(fat_bs_t *bs, devmap_handle_t devmap_handle)
+int fat_sanity_check(fat_bs_t *bs, service_id_t service_id)
 {
 	fat_cluster_t e0, e1;
@@ -707,9 +707,9 @@
 
 	for (fat_no = 0; fat_no < bs->fatcnt; fat_no++) {
-		rc = fat_get_cluster(bs, devmap_handle, fat_no, 0, &e0);
+		rc = fat_get_cluster(bs, service_id, fat_no, 0, &e0);
 		if (rc != EOK)
 			return EIO;
 
-		rc = fat_get_cluster(bs, devmap_handle, fat_no, 1, &e1);
+		rc = fat_get_cluster(bs, service_id, fat_no, 1, &e1);
 		if (rc != EOK)
 			return EIO;
