Index: uspace/lib/fdisk/include/fdisk.h
===================================================================
--- uspace/lib/fdisk/include/fdisk.h	(revision 9c2c7d2247cc1ad0410cd61ab534af9a246d328b)
+++ uspace/lib/fdisk/include/fdisk.h	(revision 5c769d54c48d3722421735c8d52378ea56e7730f)
@@ -49,5 +49,5 @@
 extern int fdisk_dev_info_get_svcname(fdisk_dev_info_t *, char **);
 extern void fdisk_dev_info_get_svcid(fdisk_dev_info_t *, service_id_t *);
-extern int fdisk_dev_info_capacity(fdisk_dev_info_t *, fdisk_cap_t *);
+extern int fdisk_dev_info_capacity(fdisk_dev_info_t *, cap_spec_t *);
 
 extern int fdisk_dev_open(fdisk_t *, service_id_t, fdisk_dev_t **);
@@ -56,5 +56,5 @@
 extern void fdisk_dev_get_flags(fdisk_dev_t *, fdisk_dev_flags_t *);
 extern int fdisk_dev_get_svcname(fdisk_dev_t *, char **);
-extern int fdisk_dev_capacity(fdisk_dev_t *, fdisk_cap_t *);
+extern int fdisk_dev_capacity(fdisk_dev_t *, cap_spec_t *);
 
 extern int fdisk_label_get_info(fdisk_dev_t *, fdisk_label_info_t *);
@@ -65,16 +65,10 @@
 extern fdisk_part_t *fdisk_part_next(fdisk_part_t *);
 extern int fdisk_part_get_info(fdisk_part_t *, fdisk_part_info_t *);
-extern int fdisk_part_get_max_avail(fdisk_dev_t *, fdisk_spc_t, fdisk_cap_t *);
-extern int fdisk_part_get_tot_avail(fdisk_dev_t *, fdisk_spc_t, fdisk_cap_t *);
+extern int fdisk_part_get_max_avail(fdisk_dev_t *, fdisk_spc_t, cap_spec_t *);
+extern int fdisk_part_get_tot_avail(fdisk_dev_t *, fdisk_spc_t, cap_spec_t *);
 extern int fdisk_part_create(fdisk_dev_t *, fdisk_part_spec_t *,
     fdisk_part_t **);
 extern int fdisk_part_destroy(fdisk_part_t *);
 extern void fdisk_pspec_init(fdisk_part_spec_t *);
-
-extern int fdisk_cap_format(fdisk_cap_t *, char **);
-extern int fdisk_cap_parse(const char *, fdisk_cap_t *);
-extern void fdisk_cap_simplify(fdisk_cap_t *);
-extern void fdisk_cap_from_blocks(uint64_t, size_t, fdisk_cap_t *);
-extern int fdisk_cap_to_blocks(fdisk_cap_t *, fdisk_cvsel_t, size_t, uint64_t *);
 
 extern int fdisk_ltype_format(label_type_t, char **);
Index: uspace/lib/fdisk/include/types/fdisk.h
===================================================================
--- uspace/lib/fdisk/include/types/fdisk.h	(revision 9c2c7d2247cc1ad0410cd61ab534af9a246d328b)
+++ uspace/lib/fdisk/include/types/fdisk.h	(revision 5c769d54c48d3722421735c8d52378ea56e7730f)
@@ -38,4 +38,5 @@
 
 #include <adt/list.h>
+#include <cap.h>
 #include <loc.h>
 #include <stdint.h>
@@ -43,27 +44,4 @@
 #include <types/vol.h>
 #include <vbd.h>
-
-/** Capacity unit */
-typedef enum {
-	cu_byte = 0,
-	cu_kbyte,
-	cu_mbyte,
-	cu_gbyte,
-	cu_tbyte,
-	cu_pbyte,
-	cu_ebyte,
-	cu_zbyte,
-	cu_ybyte
-} fdisk_cunit_t;
-
-/** Which of values within the precision of the capacity */
-typedef enum {
-	/** The nominal (middling) value */
-	fcv_nom,
-	/** The minimum value */
-	fcv_min,
-	/** The maximum value */
-	fcv_max
-} fdisk_cvsel_t;
 
 typedef enum {
@@ -85,25 +63,4 @@
 
 #define CU_LIMIT (cu_ybyte + 1)
-
-/** Partition capacity.
- *
- * Partition capacity represents both value and precision.
- * It is a decimal floating point value combined with a decimal
- * capacity unit. There is an integer mantisa @c m which in combination
- * with the number of decimal positions @c dp gives a decimal floating-point
- * number. E.g. for m = 1025 and dp = 2 the number is 10.25. If the unit
- * cunit = cu_kbyte, the capacity is 10.25 kByte, i.e. 10 250 bytes.
- *
- * Note that 1.000 kByte is equivalent to 1000 Byte, but 1 kByte is less
- * precise.
- */
-typedef struct {
-	/** Mantisa */
-	uint64_t m;
-	/** Decimal positions */
-	unsigned dp;
-	/** Capacity unit */
-	fdisk_cunit_t cunit;
-} fdisk_cap_t;
 
 /** List of devices available for managing by fdisk */
@@ -169,5 +126,5 @@
 	link_t llog_ba;
 	/** Capacity */
-	fdisk_cap_t capacity;
+	cap_spec_t capacity;
 	/** Partition kind */
 	label_pkind_t pkind;
@@ -193,5 +150,5 @@
 typedef struct {
 	/** Desired capacity */
-	fdisk_cap_t capacity;
+	cap_spec_t capacity;
 	/** Partition kind */
 	label_pkind_t pkind;
@@ -205,5 +162,5 @@
 typedef struct {
 	/** Capacity */
-	fdisk_cap_t capacity;
+	cap_spec_t capacity;
 	/** Partition kind */
 	label_pkind_t pkind;
