Index: uspace/srv/fs/fat/fat_ops.c
===================================================================
--- uspace/srv/fs/fat/fat_ops.c	(revision 4797132b9bf4f45c3d78d771e6e44d9c33778cec)
+++ uspace/srv/fs/fat/fat_ops.c	(revision 4573a79348e83cbae6141590afc45dce5aaecfca)
@@ -122,5 +122,9 @@
 #define FAT_CLST_LAST8  0xffff
 
-static block_t *fat_block_get(fat_node_t *nodep, off_t offset)
+#define fat_block_get(np, off) \
+    _fat_block_get((np)->idx->dev_handle, (np)->firstc, (off))
+
+static block_t *
+_fat_block_get(dev_handle_t dev_handle, fat_cluster_t fc, off_t offset)
 {
 	block_t *bb;
@@ -135,8 +139,8 @@
 	unsigned ssa;		/* size of the system area */
 	unsigned clusters;
-	fat_cluster_t clst = nodep->firstc;
+	fat_cluster_t clst = fc;
 	unsigned i;
 
-	bb = block_get(nodep->idx->dev_handle, BS_BLOCK);
+	bb = block_get(dev_handle, BS_BLOCK);
 	bps = uint16_t_le2host(FAT_BS(bb)->bps);
 	spc = FAT_BS(bb)->spc;
@@ -151,9 +155,8 @@
 	ssa = rscnt + fatcnt * sf + rds;
 
-	if (nodep->idx->index == FAT_CLST_RES1) {
+	if (fc == FAT_CLST_RES1) {
 		/* root directory special case */
 		assert(offset < rds);
-		b = block_get(nodep->idx->dev_handle,
-		    rscnt + fatcnt * sf + offset);
+		b = block_get(dev_handle, rscnt + fatcnt * sf + offset);
 		return b;
 	}
@@ -168,5 +171,5 @@
 		fidx = clst % (bps / sizeof(fat_cluster_t));
 		/* read FAT1 */
-		b = block_get(nodep->idx->dev_handle, rscnt + fsec);
+		b = block_get(dev_handle, rscnt + fsec);
 		clst = uint16_t_le2host(((fat_cluster_t *)b->data)[fidx]);
 		assert(clst != FAT_CLST_BAD);
@@ -175,6 +178,6 @@
 	}
 
-	b = block_get(nodep->idx->dev_handle, ssa +
-	    (clst - FAT_CLST_FIRST) * spc + offset % spc);
+	b = block_get(dev_handle, ssa + (clst - FAT_CLST_FIRST) * spc +
+	    offset % spc);
 
 	return b;
@@ -242,8 +245,47 @@
 
 /** Instantiate a FAT in-core node. */
-static void *
-fat_node_get(dev_handle_t dev_handle, fs_index_t index)
-{
-	return NULL;	/* TODO */
+static void *fat_node_get(dev_handle_t dev_handle, fs_index_t index)
+{
+	fat_idx_t *idx;
+	block_t *b;
+	fat_dentry_t *d;
+	fat_node_t *nodep;
+	unsigned bps;
+	unsigned dps;
+
+	idx = fat_idx_get_by_index(dev_handle, index);
+	if (!idx)
+		return NULL;
+
+	if (idx->nodep) {
+		/*
+		 * We are lucky.
+		 * The node is already instantiated in memory.
+		 */
+		idx->nodep->refcnt++;
+		return idx->nodep;
+	}
+
+	/*
+	 * We must instantiate the node from the file system.
+	 */
+	
+	assert(idx->pfc);
+
+	nodep = (fat_node_t *)malloc(sizeof(fat_node_t));
+	if (!nodep)
+		return NULL;
+	fat_node_initialize(nodep);
+
+	bps = fat_bps_get(dev_handle);
+	dps = bps / sizeof(fat_dentry_t);
+
+	b = _fat_block_get(dev_handle, idx->pfc,
+	    (idx->pdi * sizeof(fat_dentry_t)) / bps);
+
+	assert(b);
+
+	d = ((fat_dentry_t *)b->data) + (idx->pdi % dps);
+	/* XXX */
 }
 
@@ -399,5 +441,5 @@
 static void *fat_root_get(dev_handle_t dev_handle)
 {
-	return fat_node_get(dev_handle, FAT_CLST_RES1);
+	return fat_node_get(dev_handle, 0);	/* TODO */
 }
 
