Ignore:
File:
1 edited

Legend:

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

    r6c4eedf r9c2c7d2  
    3838
    3939#include <adt/list.h>
    40 #include <cap.h>
    4140#include <loc.h>
    4241#include <stdint.h>
     
    4443#include <types/vol.h>
    4544#include <vbd.h>
     45
     46/** Capacity unit */
     47typedef 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 */
     60typedef 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;
    4668
    4769typedef enum {
     
    6385
    6486#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 */
     100typedef 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;
    65108
    66109/** List of devices available for managing by fdisk */
     
    126169        link_t llog_ba;
    127170        /** Capacity */
    128         cap_spec_t capacity;
     171        fdisk_cap_t capacity;
    129172        /** Partition kind */
    130173        label_pkind_t pkind;
     
    150193typedef struct {
    151194        /** Desired capacity */
    152         cap_spec_t capacity;
     195        fdisk_cap_t capacity;
    153196        /** Partition kind */
    154197        label_pkind_t pkind;
     
    162205typedef struct {
    163206        /** Capacity */
    164         cap_spec_t capacity;
     207        fdisk_cap_t capacity;
    165208        /** Partition kind */
    166209        label_pkind_t pkind;
Note: See TracChangeset for help on using the changeset viewer.