Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/fdisk/include/types/fdisk.h

    r9c2c7d2 r6c4eedf  
    3838
    3939#include <adt/list.h>
     40#include <cap.h>
    4041#include <loc.h>
    4142#include <stdint.h>
     
    4344#include <types/vol.h>
    4445#include <vbd.h>
    45 
    46 /** Capacity unit */
    47 typedef enum {
    48         cu_byte = 0,
    49         cu_kbyte,
    50         cu_mbyte,
    51         cu_gbyte,
    52         cu_tbyte,
    53         cu_pbyte,
    54         cu_ebyte,
    55         cu_zbyte,
    56         cu_ybyte
    57 } fdisk_cunit_t;
    58 
    59 /** Which of values within the precision of the capacity */
    60 typedef enum {
    61         /** The nominal (middling) value */
    62         fcv_nom,
    63         /** The minimum value */
    64         fcv_min,
    65         /** The maximum value */
    66         fcv_max
    67 } fdisk_cvsel_t;
    6846
    6947typedef enum {
     
    8563
    8664#define CU_LIMIT (cu_ybyte + 1)
    87 
    88 /** Partition capacity.
    89  *
    90  * Partition capacity represents both value and precision.
    91  * It is a decimal floating point value combined with a decimal
    92  * capacity unit. There is an integer mantisa @c m which in combination
    93  * with the number of decimal positions @c dp gives a decimal floating-point
    94  * number. E.g. for m = 1025 and dp = 2 the number is 10.25. If the unit
    95  * cunit = cu_kbyte, the capacity is 10.25 kByte, i.e. 10 250 bytes.
    96  *
    97  * Note that 1.000 kByte is equivalent to 1000 Byte, but 1 kByte is less
    98  * precise.
    99  */
    100 typedef struct {
    101         /** Mantisa */
    102         uint64_t m;
    103         /** Decimal positions */
    104         unsigned dp;
    105         /** Capacity unit */
    106         fdisk_cunit_t cunit;
    107 } fdisk_cap_t;
    10865
    10966/** List of devices available for managing by fdisk */
     
    169126        link_t llog_ba;
    170127        /** Capacity */
    171         fdisk_cap_t capacity;
     128        cap_spec_t capacity;
    172129        /** Partition kind */
    173130        label_pkind_t pkind;
     
    193150typedef struct {
    194151        /** Desired capacity */
    195         fdisk_cap_t capacity;
     152        cap_spec_t capacity;
    196153        /** Partition kind */
    197154        label_pkind_t pkind;
     
    205162typedef struct {
    206163        /** Capacity */
    207         fdisk_cap_t capacity;
     164        cap_spec_t capacity;
    208165        /** Partition kind */
    209166        label_pkind_t pkind;
Note: See TracChangeset for help on using the changeset viewer.