Index: uspace/lib/label/src/mbr.c
===================================================================
--- uspace/lib/label/src/mbr.c	(revision d85131771379c9537a913b5408ad050c34f2be6b)
+++ uspace/lib/label/src/mbr.c	(revision deacc58d86dbbc4e37a7d1534bd9933e671162e1)
@@ -34,5 +34,4 @@
  */
 
-#include <block.h>
 #include <byteorder.h>
 #include <errno.h>
@@ -43,7 +42,7 @@
 #include "mbr.h"
 
-static int mbr_open(service_id_t, label_t **);
+static int mbr_open(label_bd_t *, label_t **);
 static int mbr_open_ext(label_t *);
-static int mbr_create(service_id_t, label_t **);
+static int mbr_create(label_bd_t *, label_t **);
 static void mbr_close(label_t *);
 static int mbr_destroy(label_t *);
@@ -86,5 +85,5 @@
 };
 
-static int mbr_open(service_id_t sid, label_t **rlabel)
+static int mbr_open(label_bd_t *bd, label_t **rlabel)
 {
 	label_t *label = NULL;
@@ -97,11 +96,11 @@
 	int rc;
 
-	rc = block_get_bsize(sid, &bsize);
-	if (rc != EOK) {
-		rc = EIO;
-		goto error;
-	}
-
-	rc = block_get_nblocks(sid, &nblocks);
+	rc = bd->ops->get_bsize(bd->arg, &bsize);
+	if (rc != EOK) {
+		rc = EIO;
+		goto error;
+	}
+
+	rc = bd->ops->get_nblocks(bd->arg, &nblocks);
 	if (rc != EOK) {
 		rc = EIO;
@@ -125,5 +124,5 @@
 	}
 
-	rc = block_read_direct(sid, mbr_ba, 1, mbr);
+	rc = bd->ops->read(bd->arg, mbr_ba, 1, mbr);
 	if (rc != EOK) {
 		rc = EIO;
@@ -160,5 +159,5 @@
 	label->ops = &mbr_label_ops;
 	label->ltype = lt_mbr;
-	label->svc_id = sid;
+	label->bd = *bd;
 	label->block_size = bsize;
 	label->ablock0 = mbr_ablock0;
@@ -219,5 +218,5 @@
 	while (true) {
 		/* Read EBR */
-		rc = block_read_direct(label->svc_id, ebr_b0, 1, ebr);
+		rc = label->bd.ops->read(label->bd.arg, ebr_b0, 1, ebr);
 		if (rc != EOK) {
 			rc = EIO;
@@ -280,5 +279,5 @@
 }
 
-static int mbr_create(service_id_t sid, label_t **rlabel)
+static int mbr_create(label_bd_t *bd, label_t **rlabel)
 {
 	label_t *label = NULL;
@@ -289,11 +288,11 @@
 	int rc;
 
-	rc = block_get_bsize(sid, &bsize);
-	if (rc != EOK) {
-		rc = EIO;
-		goto error;
-	}
-
-	rc = block_get_nblocks(sid, &nblocks);
+	rc = bd->ops->get_bsize(bd->arg, &bsize);
+	if (rc != EOK) {
+		rc = EIO;
+		goto error;
+	}
+
+	rc = bd->ops->get_nblocks(bd->arg, &nblocks);
 	if (rc != EOK) {
 		rc = EIO;
@@ -321,5 +320,5 @@
 	mbr->signature = host2uint16_t_le(mbr_br_signature);
 
-	rc = block_write_direct(sid, mbr_ba, 1, mbr);
+	rc = bd->ops->write(bd->arg, mbr_ba, 1, mbr);
 	if (rc != EOK) {
 		rc = EIO;
@@ -333,5 +332,5 @@
 	label->ltype = lt_mbr;
 	label->block_size = bsize;
-	label->svc_id = sid;
+	label->bd = *bd;
 	label->ablock0 = mbr_ablock0;
 	label->anblocks = nblocks - mbr_ablock0;
@@ -387,5 +386,5 @@
 	}
 
-	rc = block_write_direct(label->svc_id, mbr_ba, 1, mbr);
+	rc = label->bd.ops->write(label->bd.arg, mbr_ba, 1, mbr);
 	if (rc != EOK) {
 		rc = EIO;
@@ -998,5 +997,5 @@
 		return ENOMEM;
 
-	rc = block_read_direct(label->svc_id, mbr_ba, 1, br);
+	rc = label->bd.ops->read(label->bd.arg, mbr_ba, 1, br);
 	if (rc != EOK) {
 		rc = EIO;
@@ -1006,5 +1005,5 @@
 	br->pte[index] = *pte;
 
-	rc = block_write_direct(label->svc_id, mbr_ba, 1, br);
+	rc = label->bd.ops->write(label->bd.arg, mbr_ba, 1, br);
 	if (rc != EOK) {
 		rc = EIO;
@@ -1066,5 +1065,5 @@
 	br->signature = host2uint16_t_le(mbr_br_signature);
 
-	rc = block_write_direct(label->svc_id, ba, 1, br);
+	rc = label->bd.ops->write(label->bd.arg, ba, 1, br);
 	if (rc != EOK) {
 		rc = EIO;
@@ -1091,5 +1090,5 @@
 	ba = part->block0 - part->hdr_blocks;
 
-	rc = block_write_direct(label->svc_id, ba, 1, br);
+	rc = label->bd.ops->write(label->bd.arg, ba, 1, br);
 	if (rc != EOK) {
 		rc = EIO;
@@ -1118,5 +1117,5 @@
 		return ENOMEM;
 
-	rc = block_read_direct(label->svc_id, ba, 1, br);
+	rc = label->bd.ops->read(label->bd.arg, ba, 1, br);
 	if (rc != EOK) {
 		rc = EIO;
@@ -1133,5 +1132,5 @@
 	mbr_log_part_to_ptes(part, NULL, &br->pte[mbr_ebr_pte_next]);
 
-	rc = block_write_direct(label->svc_id, ba, 1, br);
+	rc = label->bd.ops->write(label->bd.arg, ba, 1, br);
 	if (rc != EOK) {
 		rc = EIO;
