diff options
author | Karel Zak | 2012-09-24 11:30:26 +0200 |
---|---|---|
committer | Karel Zak | 2012-09-27 13:38:13 +0200 |
commit | 749af4b6095598feadc7b934afcdf2ac7450a3c9 (patch) | |
tree | 1d105e9919a681c59dd04f1c70b8f8ccc627649a /fdisks/fdisk.h | |
parent | blkdiscard: new command (diff) | |
download | kernel-qcow2-util-linux-749af4b6095598feadc7b934afcdf2ac7450a3c9.tar.gz kernel-qcow2-util-linux-749af4b6095598feadc7b934afcdf2ac7450a3c9.tar.xz kernel-qcow2-util-linux-749af4b6095598feadc7b934afcdf2ac7450a3c9.zip |
fdisk: move partition types to label specific part
- move MBR partition types to dos_part_types.h
- make dos_part_types.h independent on datetypes to keep it useful in
all fdisks
- add struct fdisk_parrtype
- move label specific partition types to context->label
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'fdisks/fdisk.h')
-rw-r--r-- | fdisks/fdisk.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/fdisks/fdisk.h b/fdisks/fdisk.h index 05dc8a8e0..8221cd9a3 100644 --- a/fdisks/fdisk.h +++ b/fdisks/fdisk.h @@ -100,6 +100,14 @@ enum failure { typedef unsigned long long sector_t; /* + * Partition types + */ +struct fdisk_parttype { + unsigned int type; /* type as number or zero */ + char *name; /* description */ +}; + +/* * Legacy CHS based geometry */ struct fdisk_geometry { @@ -137,6 +145,9 @@ struct fdisk_context { struct fdisk_label { const char *name; + /* array with partition types */ + struct fdisk_parttype *parttypes; + /* probe disk label */ int (*probe)(struct fdisk_context *cxt); /* write in-memory changes to disk */ @@ -189,10 +200,10 @@ extern void check(struct fdisk_context *cxt, int n, unsigned int h, unsigned int extern void change_units(struct fdisk_context *cxt); extern void fatal(struct fdisk_context *cxt, enum failure why); extern int get_partition(struct fdisk_context *cxt, int warn, int max); -extern void list_types(struct systypes *sys); +extern void list_types(struct fdisk_context *cxt); extern int read_line (int *asked); extern char read_char(char *mesg); -extern int read_hex(struct systypes *sys); +extern int read_hex(struct fdisk_context *cxt); extern void reread_partition_table(struct fdisk_context *cxt, int leave); extern struct partition *get_part_table(int); extern unsigned int read_int(struct fdisk_context *cxt, @@ -203,7 +214,7 @@ extern void print_partition_size(struct fdisk_context *cxt, int num, sector_t st extern void fill_bounds(sector_t *first, sector_t *last); -extern char *partition_type(unsigned char type); +extern char *partition_type(struct fdisk_context *cxt, unsigned char type); extern void update_units(struct fdisk_context *cxt); extern char read_chars(char *mesg); extern void set_changed(int); |