Index: uspace/lib/label/Makefile
===================================================================
--- uspace/lib/label/Makefile	(revision 23c8acd9c09f549990f7478985878578dc75e2f3)
+++ uspace/lib/label/Makefile	(revision deacc58d86dbbc4e37a7d1534bd9933e671162e1)
@@ -28,5 +28,5 @@
 
 USPACE_PREFIX = ../..
-EXTRA_CFLAGS = -Iinclude -I$(LIBBLOCK_PREFIX)
+EXTRA_CFLAGS = -Iinclude
 
 LIBRARY = liblabel
Index: uspace/lib/label/include/label.h
===================================================================
--- uspace/lib/label/include/label.h	(revision 23c8acd9c09f549990f7478985878578dc75e2f3)
+++ uspace/lib/label/include/label.h	(revision deacc58d86dbbc4e37a7d1534bd9933e671162e1)
@@ -37,10 +37,9 @@
 #define LIBLABEL_LABEL_H_
 
-#include <loc.h>
 #include <types/label.h>
 #include <types/liblabel.h>
 
-extern int label_open(service_id_t, label_t **);
-extern int label_create(service_id_t, label_type_t, label_t **);
+extern int label_open(label_bd_t *, label_t **);
+extern int label_create(label_bd_t *, label_type_t, label_t **);
 extern void label_close(label_t *);
 extern int label_destroy(label_t *);
Index: uspace/lib/label/include/types/liblabel.h
===================================================================
--- uspace/lib/label/include/types/liblabel.h	(revision 23c8acd9c09f549990f7478985878578dc75e2f3)
+++ uspace/lib/label/include/types/liblabel.h	(revision deacc58d86dbbc4e37a7d1534bd9933e671162e1)
@@ -40,4 +40,5 @@
 #include <types/label.h>
 #include <offset.h>
+#include <stddef.h>
 #include <vol.h>
 #include <uuid.h>
@@ -48,9 +49,11 @@
 typedef struct label_part_info label_part_info_t;
 typedef struct label_part_spec label_part_spec_t;
+typedef struct label_bd label_bd_t;
+typedef struct label_bd_ops label_bd_ops_t;
 
 /** Ops for individual label type */
 typedef struct {
-	int (*open)(service_id_t, label_t **);
-	int (*create)(service_id_t, label_t **);
+	int (*open)(label_bd_t *, label_t **);
+	int (*create)(label_bd_t *, label_t **);
 	void (*close)(label_t *);
 	int (*destroy)(label_t *);
@@ -138,4 +141,24 @@
 } label_mbr_t;
 
+/** Block device operations */
+struct label_bd_ops {
+	/** Get block size */
+	int (*get_bsize)(void *, size_t *);
+	/** Get number of blocks */
+	int (*get_nblocks)(void *, aoff64_t *);
+	/** Read blocks */
+	int (*read)(void *, aoff64_t, size_t, void *);
+	/** Write blocks */
+	int (*write)(void *, aoff64_t, size_t, const void *);
+};
+
+/** Block device */
+struct label_bd {
+	/** Ops structure */
+	label_bd_ops_t *ops;
+	/** Argument */
+	void *arg;
+};
+
 /** Label instance */
 struct label {
@@ -144,6 +167,6 @@
 	/** Label type */
 	label_type_t ltype;
-	/** Block device service ID */
-	service_id_t svc_id;
+	/** Block device */
+	label_bd_t bd;
 	/** Partitions */
 	list_t parts; /* of label_part_t */
Index: uspace/lib/label/src/dummy.c
===================================================================
--- uspace/lib/label/src/dummy.c	(revision 23c8acd9c09f549990f7478985878578dc75e2f3)
+++ uspace/lib/label/src/dummy.c	(revision deacc58d86dbbc4e37a7d1534bd9933e671162e1)
@@ -34,5 +34,4 @@
  */
 
-#include <block.h>
 #include <errno.h>
 #include <mem.h>
@@ -41,6 +40,6 @@
 #include "dummy.h"
 
-static int dummy_open(service_id_t, label_t **);
-static int dummy_create(service_id_t, label_t **);
+static int dummy_open(label_bd_t *, label_t **);
+static int dummy_create(label_bd_t *, label_t **);
 static void dummy_close(label_t *);
 static int dummy_destroy(label_t *);
@@ -67,5 +66,5 @@
 };
 
-static int dummy_open(service_id_t sid, label_t **rlabel)
+static int dummy_open(label_bd_t *bd, label_t **rlabel)
 {
 	label_t *label = NULL;
@@ -76,5 +75,5 @@
 	int rc;
 
-	rc = block_get_bsize(sid, &bsize);
+	rc = bd->ops->get_bsize(bd->arg, &bsize);
 	if (rc != EOK) {
 		rc = EIO;
@@ -82,5 +81,5 @@
 	}
 
-	rc = block_get_nblocks(sid, &nblocks);
+	rc = bd->ops->get_nblocks(bd->arg, &nblocks);
 	if (rc != EOK) {
 		rc = EIO;
@@ -101,5 +100,5 @@
 	label->ops = &dummy_label_ops;
 	label->ltype = lt_none;
-	label->svc_id = sid;
+	label->bd = *bd;
 	label->ablock0 = ba_min;
 	label->anblocks = ba_max - ba_min + 1;
@@ -129,5 +128,5 @@
 }
 
-static int dummy_create(service_id_t sid, label_t **rlabel)
+static int dummy_create(label_bd_t *bd, label_t **rlabel)
 {
 	return ENOTSUP;
Index: uspace/lib/label/src/gpt.c
===================================================================
--- uspace/lib/label/src/gpt.c	(revision 23c8acd9c09f549990f7478985878578dc75e2f3)
+++ uspace/lib/label/src/gpt.c	(revision deacc58d86dbbc4e37a7d1534bd9933e671162e1)
@@ -35,5 +35,4 @@
 
 #include <adt/checksum.h>
-#include <block.h>
 #include <byteorder.h>
 #include <errno.h>
@@ -47,6 +46,6 @@
 #include "gpt.h"
 
-static int gpt_open(service_id_t, label_t **);
-static int gpt_create(service_id_t, label_t **);
+static int gpt_open(label_bd_t *, label_t **);
+static int gpt_create(label_bd_t *, label_t **);
 static void gpt_close(label_t *);
 static int gpt_destroy(label_t *);
@@ -71,6 +70,6 @@
 static int gpt_hdr_get_crc(gpt_header_t *, size_t, uint32_t *);
 
-static int gpt_pmbr_create(service_id_t, size_t, uint64_t);
-static int gpt_pmbr_destroy(service_id_t, size_t);
+static int gpt_pmbr_create(label_bd_t *, size_t, uint64_t);
+static int gpt_pmbr_destroy(label_bd_t *, size_t);
 
 const uint8_t efi_signature[8] = {
@@ -93,5 +92,5 @@
 };
 
-static int gpt_open(service_id_t sid, label_t **rlabel)
+static int gpt_open(label_bd_t *bd, label_t **rlabel)
 {
 	label_t *label = NULL;
@@ -118,5 +117,5 @@
 	etable[1] = NULL;
 
-	rc = block_get_bsize(sid, &bsize);
+	rc = bd->ops->get_bsize(bd->arg, &bsize);
 	if (rc != EOK) {
 		rc = EIO;
@@ -141,5 +140,5 @@
 	}
 
-	rc = block_read_direct(sid, gpt_hdr_ba, 1, gpt_hdr[0]);
+	rc = bd->ops->read(bd->arg, gpt_hdr_ba, 1, gpt_hdr[0]);
 	if (rc != EOK) {
 		rc = EIO;
@@ -149,5 +148,5 @@
 	h1ba = uint64_t_le2host(gpt_hdr[0]->alternate_lba);
 
-	rc = block_read_direct(sid, h1ba, 1, gpt_hdr[1]);
+	rc = bd->ops->read(bd->arg, h1ba, 1, gpt_hdr[1]);
 	if (rc != EOK) {
 		rc = EIO;
@@ -277,5 +276,5 @@
 		}
 
-		rc = block_read_direct(sid, ptba[j], pt_blocks / 2, etable[j]);
+		rc = bd->ops->read(bd->arg, ptba[j], pt_blocks / 2, etable[j]);
 		if (rc != EOK) {
 			rc = EIO;
@@ -308,5 +307,5 @@
 	label->ops = &gpt_label_ops;
 	label->ltype = lt_gpt;
-	label->svc_id = sid;
+	label->bd = *bd;
 	label->ablock0 = ba_min;
 	label->anblocks = ba_max - ba_min + 1;
@@ -334,5 +333,5 @@
 }
 
-static int gpt_create(service_id_t sid, label_t **rlabel)
+static int gpt_create(label_bd_t *bd, label_t **rlabel)
 {
 	label_t *label = NULL;
@@ -353,5 +352,5 @@
 	int rc;
 
-	rc = block_get_bsize(sid, &bsize);
+	rc = bd->ops->get_bsize(bd->arg, &bsize);
 	if (rc != EOK) {
 		rc = EIO;
@@ -364,5 +363,5 @@
 	}
 
-	rc = block_get_nblocks(sid, &nblocks);
+	rc = bd->ops->get_nblocks(bd->arg, &nblocks);
 	if (rc != EOK) {
 		rc = EIO;
@@ -380,5 +379,5 @@
 	}
 
-	rc = gpt_pmbr_create(sid, bsize, nblocks);
+	rc = gpt_pmbr_create(bd, bsize, nblocks);
 	if (rc != EOK) {
 		rc = EIO;
@@ -405,5 +404,5 @@
 		}
 
-		rc = block_write_direct(sid, ptba[i], pt_blocks, etable);
+		rc = bd->ops->write(bd->arg, ptba[i], pt_blocks, etable);
 		if (rc != EOK) {
 			rc = EIO;
@@ -440,5 +439,5 @@
 		gpt_hdr_compute_crc(gpt_hdr, sizeof(gpt_header_t));
 
-		rc = block_write_direct(sid, hdr_ba[i], 1, gpt_hdr);
+		rc = bd->ops->write(bd->arg, hdr_ba[i], 1, gpt_hdr);
 		if (rc != EOK) {
 			rc = EIO;
@@ -460,5 +459,5 @@
 	label->ops = &gpt_label_ops;
 	label->ltype = lt_gpt;
-	label->svc_id = sid;
+	label->bd = *bd;
 	label->ablock0 = ba_min;
 	label->anblocks = ba_max - ba_min + 1;
@@ -520,5 +519,5 @@
 		}
 
-		rc = block_write_direct(label->svc_id, label->lt.gpt.hdr_ba[i],
+		rc = label->bd.ops->write(label->bd.arg, label->lt.gpt.hdr_ba[i],
 		    1, gpt_hdr);
 		if (rc != EOK) {
@@ -537,5 +536,5 @@
 		}
 
-		rc = block_write_direct(label->svc_id,
+		rc = label->bd.ops->write(label->bd.arg,
 		    label->lt.gpt.ptable_ba[i], label->lt.gpt.pt_blocks,
 		    etable);
@@ -549,5 +548,5 @@
 	}
 
-	rc = gpt_pmbr_destroy(label->svc_id, label->block_size);
+	rc = gpt_pmbr_destroy(&label->bd, label->block_size);
 	if (rc != EOK)
 		goto error;
@@ -871,5 +870,5 @@
 		nblocks = label->lt.gpt.pt_blocks;
 
-		rc = block_read_direct(label->svc_id, ba, nblocks, buf);
+		rc = label->bd.ops->read(label->bd.arg, ba, nblocks, buf);
 		if (rc != EOK) {
 			rc = EIO;
@@ -888,5 +887,5 @@
 		*e = *pte;
 
-		rc = block_write_direct(label->svc_id, ba, nblocks, buf);
+		rc = label->bd.ops->write(label->bd.arg, ba, nblocks, buf);
 		if (rc != EOK) {
 			rc = EIO;
@@ -923,5 +922,5 @@
 
 	for (i = 0; i < 2; i++) {
-		rc = block_read_direct(label->svc_id,
+		rc = label->bd.ops->read(label->bd.arg,
 		    label->lt.gpt.hdr_ba[i], 1, gpt_hdr);
 		if (rc != EOK) {
@@ -933,5 +932,5 @@
 		gpt_hdr_compute_crc(gpt_hdr, label->lt.gpt.hdr_size);
 
-		rc = block_write_direct(label->svc_id,
+		rc = label->bd.ops->write(label->bd.arg,
 		    label->lt.gpt.hdr_ba[i], 1, gpt_hdr);
 		if (rc != EOK) {
@@ -940,7 +939,7 @@
 		}
 	}
-	
+
 	rc = EOK;
-	
+
 exit:
 	free(gpt_hdr);
@@ -974,5 +973,5 @@
 
 /** Create GPT Protective MBR */
-static int gpt_pmbr_create(service_id_t sid, size_t bsize, uint64_t nblocks)
+static int gpt_pmbr_create(label_bd_t *bd, size_t bsize, uint64_t nblocks)
 {
 	mbr_br_block_t *pmbr = NULL;
@@ -998,5 +997,5 @@
 	pmbr->signature = host2uint16_t_le(mbr_br_signature);
 
-	rc = block_write_direct(sid, mbr_ba, 1, pmbr);
+	rc = bd->ops->write(bd->arg, mbr_ba, 1, pmbr);
 	if (rc != EOK) {
 		rc = EIO;
@@ -1012,5 +1011,5 @@
 
 /** Destroy GPT Protective MBR */
-static int gpt_pmbr_destroy(service_id_t sid, size_t bsize)
+static int gpt_pmbr_destroy(label_bd_t *bd, size_t bsize)
 {
 	mbr_br_block_t *pmbr = NULL;
@@ -1023,5 +1022,5 @@
 	}
 
-	rc = block_write_direct(sid, mbr_ba, 1, pmbr);
+	rc = bd->ops->write(bd->arg, mbr_ba, 1, pmbr);
 	if (rc != EOK) {
 		rc = EIO;
Index: uspace/lib/label/src/label.c
===================================================================
--- uspace/lib/label/src/label.c	(revision 23c8acd9c09f549990f7478985878578dc75e2f3)
+++ uspace/lib/label/src/label.c	(revision deacc58d86dbbc4e37a7d1534bd9933e671162e1)
@@ -51,5 +51,5 @@
 };
 
-int label_open(service_id_t sid, label_t **rlabel)
+int label_open(label_bd_t *bd, label_t **rlabel)
 {
 	label_ops_t **ops;
@@ -58,5 +58,5 @@
 	ops = &probe_list[0];
 	while (ops[0] != NULL) {
-		rc = ops[0]->open(sid, rlabel);
+		rc = ops[0]->open(bd, rlabel);
 		if (rc == EOK)
 			return EOK;
@@ -67,5 +67,5 @@
 }
 
-int label_create(service_id_t sid, label_type_t ltype, label_t **rlabel)
+int label_create(label_bd_t *bd, label_type_t ltype, label_t **rlabel)
 {
 	label_ops_t *ops = NULL;
@@ -85,5 +85,5 @@
 		return ENOTSUP;
 
-	return ops->create(sid, rlabel);
+	return ops->create(bd, rlabel);
 }
 
Index: uspace/lib/label/src/mbr.c
===================================================================
--- uspace/lib/label/src/mbr.c	(revision 23c8acd9c09f549990f7478985878578dc75e2f3)
+++ 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;
