Index: uspace/srv/fs/fat/fat_ops.c
===================================================================
--- uspace/srv/fs/fat/fat_ops.c	(revision e17d9864c53f11ebc53e09dd580c296a05be77d4)
+++ uspace/srv/fs/fat/fat_ops.c	(revision cb682eb07450f342db8202b36326ce2d82c4b5fe)
@@ -126,5 +126,5 @@
 static void *fat_node_get_core(fat_idx_t *idxp)
 {
-	block_t *b;
+	block_t *bb, *b;
 	fat_dentry_t *d;
 	fat_node_t *nodep = NULL;
@@ -179,9 +179,10 @@
 	fat_node_initialize(nodep);
 
-	bps = fat_bps_get(idxp->dev_handle);
+	bb = block_get(idxp->dev_handle, BS_BLOCK, BS_SIZE);
+	bps = uint16_t_le2host(FAT_BS(bb)->bps);
 	dps = bps / sizeof(fat_dentry_t);
 
 	/* Read the block that contains the dentry of interest. */
-	b = _fat_block_get(idxp->dev_handle, idxp->pfc,
+	b = _fat_block_get(bb->data, idxp->dev_handle, idxp->pfc,
 	    (idxp->pdi * sizeof(fat_dentry_t)) / bps);
 	assert(b);
@@ -200,5 +201,5 @@
 		 * size of the directory by walking the FAT.
 		 */
-		nodep->size = bps * _fat_blcks_get(idxp->dev_handle,
+		nodep->size = bps * _fat_blcks_get(bb->data, idxp->dev_handle,
 		    uint16_t_le2host(d->firstc), NULL);
 	} else {
@@ -211,4 +212,5 @@
 
 	block_put(b);
+	block_put(bb);
 
 	/* Link the idx structure with the node structure. */
@@ -276,8 +278,9 @@
 	unsigned blocks;
 	fat_dentry_t *d;
-	block_t *b;
+	block_t *bb, *b;
 
 	futex_down(&parentp->idx->lock);
-	bps = fat_bps_get(parentp->idx->dev_handle);
+	bb = block_get(parentp->idx->dev_handle, BS_BLOCK, BS_SIZE);
+	bps = uint16_t_le2host(FAT_BS(bb)->bps);
 	dps = bps / sizeof(fat_dentry_t);
 	blocks = parentp->size / bps + (parentp->size % bps != 0);
@@ -285,5 +288,5 @@
 		unsigned dentries;
 		
-		b = fat_block_get(parentp, i);
+		b = fat_block_get(bb->data, parentp, i);
 		dentries = (i == blocks - 1) ?
 		    parentp->size % sizeof(fat_dentry_t) :
@@ -296,4 +299,5 @@
 			case FAT_DENTRY_LAST:
 				block_put(b);
+				block_put(bb);
 				futex_up(&parentp->idx->lock);
 				return NULL;
@@ -322,4 +326,5 @@
 					 */
 					block_put(b);
+					block_put(bb);
 					return NULL;
 				}
@@ -327,4 +332,5 @@
 				futex_up(&idx->lock);
 				block_put(b);
+				block_put(bb);
 				return node;
 			}
@@ -332,4 +338,6 @@
 		block_put(b);
 	}
+	block_put(bb);
+
 	futex_up(&parentp->idx->lock);
 	return NULL;
@@ -360,5 +368,5 @@
 	unsigned dps;
 	unsigned blocks;
-	block_t *b;
+	block_t *bb, *b;
 	unsigned i, j;
 
@@ -367,5 +375,6 @@
 
 	futex_down(&nodep->idx->lock);
-	bps = fat_bps_get(nodep->idx->dev_handle);
+	bb = block_get(nodep->idx->dev_handle, BS_BLOCK, BS_SIZE);
+	bps = uint16_t_le2host(FAT_BS(bb)->bps);
 	dps = bps / sizeof(fat_dentry_t);
 
@@ -376,5 +385,5 @@
 		fat_dentry_t *d;
 	
-		b = fat_block_get(nodep, i);
+		b = fat_block_get(bb->data, nodep, i);
 		dentries = (i == blocks - 1) ?
 		    nodep->size % sizeof(fat_dentry_t) :
@@ -387,4 +396,5 @@
 			case FAT_DENTRY_LAST:
 				block_put(b);
+				block_put(bb);
 				futex_up(&nodep->idx->lock);
 				return false;
@@ -392,8 +402,10 @@
 			case FAT_DENTRY_VALID:
 				block_put(b);
+				block_put(bb);
 				futex_up(&nodep->idx->lock);
 				return true;
 			}
 			block_put(b);
+			block_put(bb);
 			futex_up(&nodep->idx->lock);
 			return true;
@@ -401,4 +413,5 @@
 		block_put(b);
 	}
+	block_put(bb);
 
 	futex_up(&nodep->idx->lock);
@@ -553,7 +566,7 @@
 	off_t pos = (off_t)IPC_GET_ARG3(*request);
 	fat_node_t *nodep = (fat_node_t *)fat_node_get(dev_handle, index);
-	uint16_t bps = fat_bps_get(dev_handle);
+	uint16_t bps;
 	size_t bytes;
-	block_t *b;
+	block_t *bb, *b;
 
 	if (!nodep) {
@@ -570,4 +583,7 @@
 		return;
 	}
+
+	bb = block_get(dev_handle, BS_BLOCK, BS_SIZE);
+	bps = uint16_t_le2host(FAT_BS(bb)->bps);
 
 	if (nodep->type == FAT_FILE) {
@@ -578,5 +594,5 @@
 		 */
 		bytes = min(len, bps - pos % bps);
-		b = fat_block_get(nodep, pos / bps);
+		b = fat_block_get(bb->data, nodep, pos / bps);
 		(void) ipc_data_read_finalize(callid, b->data + pos % bps,
 		    bytes);
@@ -602,5 +618,5 @@
 			off_t o;
 
-			b = fat_block_get(nodep, bnum);
+			b = fat_block_get(bb->data, nodep, bnum);
 			for (o = pos % (bps / sizeof(fat_dentry_t));
 			    o < bps / sizeof(fat_dentry_t);
@@ -625,4 +641,5 @@
 miss:
 		fat_node_put(nodep);
+		block_put(bb);
 		ipc_answer_0(callid, ENOENT);
 		ipc_answer_1(rid, ENOENT, 0);
@@ -634,4 +651,5 @@
 
 	fat_node_put(nodep);
+	block_put(bb);
 	ipc_answer_1(rid, EOK, (ipcarg_t)bytes);
 }
@@ -682,5 +700,4 @@
 	bps = uint16_t_le2host(FAT_BS(bb)->bps);
 	spc = FAT_BS(bb)->spc;
-	block_put(bb);
 	
 	boundary = ROUND_UP(nodep->size, bps * spc);
@@ -692,6 +709,6 @@
 		 * next block size boundary.
 		 */
-		fat_fill_gap(nodep, FAT_CLST_RES0, pos);
-		b = fat_block_get(nodep, pos / bps);
+		fat_fill_gap(bb->data, nodep, FAT_CLST_RES0, pos);
+		b = fat_block_get(bb->data, nodep, pos / bps);
 		(void) ipc_data_write_finalize(callid, b->data + pos % bps,
 		    bytes);
@@ -703,4 +720,5 @@
 		}
 		fat_node_put(nodep);
+		block_put(bb);
 		ipc_answer_1(rid, EOK, bytes);	
 		return;
@@ -717,8 +735,10 @@
 		    bps * spc;
 		/* create an independent chain of nclsts clusters in all FATs */
-		status = fat_alloc_clusters(dev_handle, nclsts, &mcl, &lcl);
+		status = fat_alloc_clusters(bb->data, dev_handle, nclsts, &mcl,
+		    &lcl);
 		if (status != EOK) {
 			/* could not allocate a chain of nclsts clusters */
 			fat_node_put(nodep);
+			block_put(bb);
 			ipc_answer_0(callid, status);
 			ipc_answer_0(rid, status);
@@ -726,6 +746,7 @@
 		}
 		/* zero fill any gaps */
-		fat_fill_gap(nodep, mcl, pos);
-		b = _fat_block_get(dev_handle, lcl, (pos / bps) % spc);
+		fat_fill_gap(bb->data, nodep, mcl, pos);
+		b = _fat_block_get(bb->data, dev_handle, lcl,
+		    (pos / bps) % spc);
 		(void) ipc_data_write_finalize(callid, b->data + pos % bps,
 		    bytes);
@@ -736,8 +757,9 @@
 		 * node's cluster chain.
 		 */
-		fat_append_clusters(nodep, mcl);
+		fat_append_clusters(bb->data, nodep, mcl);
 		nodep->size = pos + bytes;
 		nodep->dirty = true;		/* need to sync node */
 		fat_node_put(nodep);
+		block_put(bb);
 		ipc_answer_1(rid, EOK, bytes);
 		return;
