Changeset 9854a8f in mainline for uspace/lib/fdisk/include


Ignore:
Timestamp:
2015-10-24T22:06:34Z (10 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
03661d19
Parents:
ef9dac04
Message:

Capacity simplification, for display.

Location:
uspace/lib/fdisk/include
Files:
2 edited

Legend:

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

    ref9dac04 r9854a8f  
    7373extern int fdisk_cap_format(fdisk_cap_t *, char **);
    7474extern int fdisk_cap_parse(const char *, fdisk_cap_t *);
     75extern void fdisk_cap_simplify(fdisk_cap_t *);
     76extern void fdisk_cap_from_blocks(uint64_t, size_t, fdisk_cap_t *);
     77extern int fdisk_cap_to_blocks(fdisk_cap_t *, size_t, uint64_t *);
     78
    7579extern int fdisk_ltype_format(label_type_t, char **);
    7680extern int fdisk_fstype_format(vol_fstype_t, char **);
  • uspace/lib/fdisk/include/types/fdisk.h

    ref9dac04 r9854a8f  
    7777#define CU_LIMIT (cu_ybyte + 1)
    7878
    79 /** Partition capacity */
    80 typedef struct {
    81         uint64_t value;
     79/** Partition capacity.
     80 *
     81 * Partition capacity represents both value and precision.
     82 * It is a decimal floating point value combined with a decimal
     83 * capacity unit. There is an integer mantisa @c m which in combination
     84 * with the number of decimal positions @c dp gives a decimal floating-point
     85 * number. E.g. for m = 1025 and dp = 2 the number is 10.25. If the unit
     86 * cunit = cu_kbyte, the capacity is 10.25 kByte, i.e. 10 250 bytes.
     87 *
     88 * Note that 1.000 kByte is equivalent to 1000 Byte, but 1 kByte is less
     89 * precise.
     90 */
     91typedef struct {
     92        /** Mantisa */
     93        uint64_t m;
     94        /** Decimal positions */
     95        unsigned dp;
     96        /** Capacity unit */
    8297        fdisk_cunit_t cunit;
    8398} fdisk_cap_t;
Note: See TracChangeset for help on using the changeset viewer.