libparted 3.6
Loading...
Searching...
No Matches
disk.h
Go to the documentation of this file.
1/*
2 libparted - a library for manipulating disk partitions
3 Copyright (C) 1999-2002, 2007-2014, 2019-2023 Free Software Foundation,
4 Inc.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
27#ifndef PED_DISK_H_INCLUDED
28#define PED_DISK_H_INCLUDED
29
30/* Include these to work around gnulib redefining free, read, etc. which causes problems
31 * with pt-common.h
32 */
33#include <stdlib.h>
34#include <unistd.h>
35#include <stdint.h>
36
41 /* This flag (which defaults to true) controls if disk types for
42 which cylinder alignment is optional do cylinder alignment when a
43 new partition gets added.
44 This flag is available for msdos and sun disklabels (for sun labels
45 it only controls the aligning of the end of the partition) */
47 /* This flag controls whether the boot flag of a GPT PMBR is set */
49};
50// NOTE: DO NOT define using enums
51#define PED_DISK_FIRST_FLAG 1 // PED_DISK_CYLINDER_ALIGNMENT
52#define PED_DISK_LAST_FLAG 2 // PED_DISK_GPT_PMBR_BOOT
53
64};
65
92};
93// NOTE: DO NOT define using enums
94#define PED_PARTITION_FIRST_FLAG 1 // PED_PARTITION_BOOT
95#define PED_PARTITION_LAST_FLAG 22 // PED_PARTITION_NO_AUTOMOUNT
96
104};
105// NOTE: DO NOT define using enums
106#define PED_DISK_TYPE_FIRST_FEATURE 1 // PED_DISK_TYPE_EXTENDED
107#define PED_DISK_TYPE_LAST_FEATURE 32 // PED_DISK_TYPE_PARTITION_UUID
108
109struct _PedDisk;
110struct _PedPartition;
111struct _PedDiskOps;
112struct _PedDiskType;
113struct _PedDiskArchOps;
114
119typedef struct _PedDisk PedDisk;
121typedef const struct _PedDiskOps PedDiskOps;
123typedef const struct _PedDiskArchOps PedDiskArchOps;
124
125#include <parted/device.h>
126#include <parted/filesys.h>
127#include <parted/natmath.h>
128#include <parted/geom.h>
129#include <stdbool.h>
130
147
157 int num;
178
183
185};
186
197struct _PedDisk {
201 const int* block_sizes;
207
208/* office use only ;-) */
213};
214
216 /* disk label operations */
217 int (*probe) (const PedDevice *dev);
218 int (*clobber) (PedDevice* dev);
219 PedDisk* (*alloc) (const PedDevice* dev);
220 PedDisk* (*duplicate) (const PedDisk* disk);
221 void (*free) (PedDisk* disk);
222 int (*read) (PedDisk* disk);
223 int (*write) (const PedDisk* disk);
225 PedDisk *disk,
226 PedDiskFlag flag,
227 int state);
229 const PedDisk *disk,
230 PedDiskFlag flag);
232 const PedDisk *disk,
233 PedDiskFlag flag);
234 uint8_t* (*disk_get_uuid) (const PedDisk* disk);
237 /* partition operations */
238 PedPartition* (*partition_new) (
239 const PedDisk* disk,
240 PedPartitionType part_type,
241 const PedFileSystemType* fs_type,
243 PedSector end);
244 PedPartition* (*partition_duplicate) (const PedPartition* part);
247 const PedFileSystemType* fs_type);
249 PedPartition* part,
250 PedPartitionFlag flag,
251 int state);
253 const PedPartition* part,
254 PedPartitionFlag flag);
256 const PedPartition* part,
257 PedPartitionFlag flag);
258 void (*partition_set_name) (PedPartition* part, const char* name);
259 const char* (*partition_get_name) (const PedPartition* part);
260
261 int (*partition_set_type_id) (PedPartition* part, uint8_t id);
262 uint8_t (*partition_get_type_id) (const PedPartition* part);
263
264 int (*partition_set_type_uuid) (PedPartition* part, const uint8_t* uuid);
265 uint8_t* (*partition_get_type_uuid) (const PedPartition* part);
266
267 uint8_t* (*partition_get_uuid) (const PedPartition* part);
268
270 const PedConstraint* constraint);
272 bool (*partition_check) (const PedPartition* part);
273
274 /* other */
275 int (*alloc_metadata) (PedDisk* disk);
278 int* supported);
279 PedAlignment *(*get_partition_alignment)(const PedDisk *disk);
282};
283
286 const char* name;
289
291};
292
298 char* (*partition_get_path) (const PedPartition* part);
299 int (*partition_is_busy) (const PedPartition* part);
300 int (*disk_commit) (PedDisk* disk);
301};
302
305
307
308#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
309 __attribute ((__pure__))
310#endif
311;
312extern PedDiskType* ped_disk_type_get (const char* name)
313
314#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
315 __attribute ((__pure__))
316#endif
317;
318extern int ped_disk_type_check_feature (const PedDiskType* disk_type,
319 PedDiskTypeFeature feature)
320
321#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
322 __attribute ((__pure__))
323#endif
324;
325
327extern int ped_disk_clobber (PedDevice* dev);
328extern PedDisk* ped_disk_new (PedDevice* dev);
330 const PedDiskType* disk_type);
331extern PedDisk* ped_disk_duplicate (const PedDisk* old_disk);
332extern void ped_disk_destroy (PedDisk* disk);
333extern int ped_disk_commit (PedDisk* disk);
334extern int ped_disk_commit_to_dev (PedDisk* disk);
335extern int ped_disk_commit_to_os (PedDisk* disk);
336extern int ped_disk_check (const PedDisk* disk);
337extern void ped_disk_print (const PedDisk* disk);
338
339extern int ped_disk_get_primary_partition_count (const PedDisk* disk)
340
341#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
342 __attribute ((__pure__))
343#endif
344;
345extern int ped_disk_get_last_partition_num (const PedDisk* disk)
346
347#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
348 __attribute ((__pure__))
349#endif
350;
353 int* supported);
355
356extern int ped_disk_set_flag(PedDisk *disk, PedDiskFlag flag, int state);
357extern int ped_disk_get_flag(const PedDisk *disk, PedDiskFlag flag);
358extern int ped_disk_is_flag_available(const PedDisk *disk, PedDiskFlag flag);
359
360extern uint8_t* ped_disk_get_uuid (const PedDisk* disk);
361
362extern const char *ped_disk_flag_get_name(PedDiskFlag flag);
363extern PedDiskFlag ped_disk_flag_get_by_name(const char *name);
365#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
366 __attribute ((__const__))
367#endif
368;
369
378extern PedPartition* ped_partition_new (const PedDisk* disk,
380 const PedFileSystemType* fs_type,
382 PedSector end);
383extern void ped_partition_destroy (PedPartition* part);
384extern int ped_partition_is_active (const PedPartition* part)
385#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
386 __attribute ((__pure__))
387#endif
388;
390 int state);
391extern int ped_partition_get_flag (const PedPartition* part,
392 PedPartitionFlag flag);
393extern int ped_partition_is_flag_available (const PedPartition* part,
394 PedPartitionFlag flag);
395extern int ped_partition_set_system (PedPartition* part,
396 const PedFileSystemType* fs_type);
397extern int ped_partition_set_name (PedPartition* part, const char* name);
398extern const char* ped_partition_get_name (const PedPartition* part);
399
400extern int ped_partition_set_type_id (PedPartition* part, uint8_t id);
401extern uint8_t ped_partition_get_type_id (const PedPartition* part);
402
403extern int ped_partition_set_type_uuid (PedPartition* part, const uint8_t* uuid);
404extern uint8_t* ped_partition_get_type_uuid (const PedPartition* part);
405
406extern uint8_t* ped_partition_get_uuid (const PedPartition* part);
407
408extern int ped_partition_is_busy (const PedPartition* part);
409extern char* ped_partition_get_path (const PedPartition* part);
410
411extern const char* ped_partition_type_get_name (PedPartitionType part_type)
412
413#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
414 __attribute ((__const__))
415#endif
416;
417extern const char* ped_partition_flag_get_name (PedPartitionFlag flag);
420
421#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
422 __attribute ((__const__))
423#endif
424;
425
433extern int ped_disk_add_partition (PedDisk* disk, PedPartition* part,
434 const PedConstraint* constraint);
435extern int ped_disk_remove_partition (PedDisk* disk, PedPartition* part);
436extern int ped_disk_delete_partition (PedDisk* disk, PedPartition* part);
437extern int ped_disk_delete_all (PedDisk* disk);
438extern int ped_disk_set_partition_geom (PedDisk* disk, PedPartition* part,
439 const PedConstraint* constraint,
441extern int ped_disk_maximize_partition (PedDisk* disk, PedPartition* part,
442 const PedConstraint* constraint);
444 PedPartition* part, const PedConstraint* constraint);
446
447extern PedPartition* ped_disk_next_partition (const PedDisk* disk,
448 const PedPartition* part)
449
450#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
451 __attribute ((__pure__))
452#endif
453;
454extern PedPartition* ped_disk_get_partition (const PedDisk* disk, int num)
455
456#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
457 __attribute ((__pure__))
458#endif
459;
461 PedSector sect)
462
463#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
464 __attribute ((__pure__))
465#endif
466;
468
469#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
470 __attribute ((__pure__))
471#endif
472;
473
476
477/* internal functions */
478extern PedDisk* _ped_disk_alloc (const PedDevice* dev, const PedDiskType* type);
479extern void _ped_disk_free (PedDisk* disk);
480
481
490extern PedPartition* _ped_partition_alloc (const PedDisk* disk,
492 const PedFileSystemType* fs_type,
494 PedSector end);
495extern void _ped_partition_free (PedPartition* part);
496
498 PedPartition* part, const PedConstraint* external,
499 PedConstraint* internal);
500
501#endif /* PED_DISK_H_INCLUDED */
502
uint8_t type
Definition: dos.c:2
uint32_t start
Definition: dos.c:4
uint8_t uuid[16]
Definition: f2fs.h:27
long long PedSector
We can address 2^63 sectors.
Definition: device.h:31
void _ped_disk_free(PedDisk *disk)
Definition: disk.c:417
_PedDiskFlag
Disk flags.
Definition: disk.h:40
_PedDiskTypeFeature
Definition: disk.h:97
PedPartition * ped_disk_get_partition_by_sector(const PedDisk *disk, PedSector sect)
Returns the partition that contains sect.
Definition: disk.c:1784
bool ped_disk_get_max_supported_partition_count(const PedDisk *disk, int *supported)
Get the highest supported partition number on disk.
Definition: disk.c:710
int ped_disk_get_max_primary_partition_count(const PedDisk *disk)
Get the maximum number of (primary) partitions the disk label supports.
Definition: disk.c:745
const char * ped_disk_flag_get_name(PedDiskFlag flag)
Returns a name for a flag, e.g.
Definition: disk.c:837
PedSector ped_disk_max_partition_start_sector(const PedDisk *disk)
Return the maximum representable start sector of a partition on disk \disk.
Definition: disk.c:1819
_PedPartitionType
Partition types.
Definition: disk.h:57
uint8_t * ped_disk_get_uuid(const PedDisk *disk)
Get the uuid of the disk disk.
Definition: disk.c:909
PedPartition * ped_disk_extended_partition(const PedDisk *disk)
Definition: disk.c:1688
int ped_disk_type_check_feature(const PedDiskType *disk_type, PedDiskTypeFeature feature)
This function checks if a particular type of partition table supports a feature.
Definition: disk.c:657
int ped_disk_set_flag(PedDisk *disk, PedDiskFlag flag, int state)
Set the state (1 or 0) of a flag on a disk.
Definition: disk.c:764
int ped_disk_commit_to_dev(PedDisk *disk)
Write the changes made to the in-memory description of a partition table to the device.
Definition: disk.c:478
int ped_disk_remove_partition(PedDisk *disk, PedPartition *part)
Removes PedPartition part from PedDisk disk.
Definition: disk.c:2187
enum _PedPartitionFlag PedPartitionFlag
Definition: disk.h:117
int ped_disk_add_partition(PedDisk *disk, PedPartition *part, const PedConstraint *constraint)
Adds PedPartition part to PedDisk disk.
Definition: disk.c:2116
PedDisk * _ped_disk_alloc(const PedDevice *dev, const PedDiskType *type)
Definition: disk.c:397
int ped_disk_check(const PedDisk *disk)
Perform a sanity check on a partition table.
Definition: disk.c:599
PedGeometry * ped_disk_get_max_partition_geometry(PedDisk *disk, PedPartition *part, const PedConstraint *constraint)
Get the maximum geometry part can be grown to, subject to constraint.
Definition: disk.c:2418
int ped_disk_get_flag(const PedDisk *disk, PedDiskFlag flag)
Get the state (1 or 0) of a flag on a disk.
Definition: disk.c:798
PedAlignment * ped_disk_get_partition_alignment(const PedDisk *disk)
Get the alignment needed for partition boundaries on this disk.
Definition: disk.c:729
_PedPartitionFlag
Partition flags.
Definition: disk.h:69
int ped_disk_is_flag_available(const PedDisk *disk, PedDiskFlag flag)
Check whether a given flag is available on a disk.
Definition: disk.c:816
PedDiskFlag ped_disk_flag_get_by_name(const char *name)
Returns the flag associated with name.
Definition: disk.c:861
enum _PedDiskTypeFeature PedDiskTypeFeature
Definition: disk.h:118
int ped_disk_maximize_partition(PedDisk *disk, PedPartition *part, const PedConstraint *constraint)
Grow PedPartition part geometry to the maximum possible subject to constraint.
Definition: disk.c:2356
int ped_disk_delete_partition(PedDisk *disk, PedPartition *part)
Removes part from disk, and destroys part.
Definition: disk.c:2211
void ped_disk_destroy(PedDisk *disk)
Close disk.
Definition: disk.c:432
PedDiskType * ped_disk_type_get_next(PedDiskType const *type)
Return the next disk type registers, after "type".
Definition: disk.c:106
PedPartition * ped_disk_next_partition(const PedDisk *disk, const PedPartition *part)
Return the next partition after part on disk.
Definition: disk.c:1711
enum _PedPartitionType PedPartitionType
Definition: disk.h:116
PedDiskType * ped_disk_probe(PedDevice *dev)
Return the type of partition table detected on "dev".
Definition: disk.c:140
PedSector ped_disk_max_partition_length(const PedDisk *disk)
Return the maximum representable length (in sectors) of a partition on disk \disk.
Definition: disk.c:1809
PedPartition * ped_disk_get_partition(const PedDisk *disk, int num)
Returns the partition numbered num.
Definition: disk.c:1763
int ped_disk_get_last_partition_num(const PedDisk *disk)
Get the highest available partition number on disk.
Definition: disk.c:688
void ped_disk_type_unregister(PedDiskType *type)
Definition: disk.c:81
int ped_disk_commit_to_os(PedDisk *disk)
Tell the operating system kernel about the partition table layout of disk.
Definition: disk.c:454
PedDisk * ped_disk_duplicate(const PedDisk *old_disk)
Clone a PedDisk object.
Definition: disk.c:251
PedDisk * ped_disk_new(PedDevice *dev)
Read the partition table off a device (if one is found).
Definition: disk.c:181
int ped_disk_commit(PedDisk *disk)
Definition: disk.c:522
PedDiskFlag ped_disk_flag_next(PedDiskFlag flag)
Iterates through all disk flags.
Definition: disk.c:884
enum _PedDiskFlag PedDiskFlag
Definition: disk.h:115
int ped_disk_clobber(PedDevice *dev)
Remove all identifying signatures of a partition table,.
Definition: disk.c:311
int ped_disk_get_primary_partition_count(const PedDisk *disk)
Get the number of primary partitions.
Definition: disk.c:667
void ped_disk_type_register(PedDiskType *type)
Definition: disk.c:70
int ped_disk_delete_all(PedDisk *disk)
Removes and destroys all partitions on disk.
Definition: disk.c:2254
void ped_disk_print(const PedDisk *disk)
Prints a summary of disk's partitions.
Definition: disk.c:2657
int ped_disk_set_partition_geom(PedDisk *disk, PedPartition *part, const PedConstraint *constraint, PedSector start, PedSector end)
Sets the geometry of part (i.e.
Definition: disk.c:2292
PedDiskType * ped_disk_type_get(const char *name)
Return the disk type with a name of "name".
Definition: disk.c:120
int ped_disk_minimize_extended_partition(PedDisk *disk)
Reduce the size of the extended partition to a minimum while still wrapping its logical partitions.
Definition: disk.c:2455
PedDisk * ped_disk_new_fresh(PedDevice *dev, const PedDiskType *disk_type)
Create a new partition table on dev.
Definition: disk.c:369
@ PED_DISK_GPT_PMBR_BOOT
Definition: disk.h:48
@ PED_DISK_CYLINDER_ALIGNMENT
Definition: disk.h:46
@ PED_DISK_TYPE_PARTITION_UUID
supports partition uuids
Definition: disk.h:103
@ PED_DISK_TYPE_PARTITION_TYPE_UUID
supports partition type-uuids
Definition: disk.h:101
@ PED_DISK_TYPE_PARTITION_TYPE_ID
supports partition type-ids
Definition: disk.h:100
@ PED_DISK_TYPE_PARTITION_NAME
supports partition names
Definition: disk.h:99
@ PED_DISK_TYPE_EXTENDED
supports extended partitions
Definition: disk.h:98
@ PED_DISK_TYPE_DISK_UUID
supports disk uuids
Definition: disk.h:102
@ PED_PARTITION_METADATA
Definition: disk.h:62
@ PED_PARTITION_FREESPACE
Definition: disk.h:61
@ PED_PARTITION_PROTECTED
Definition: disk.h:63
@ PED_PARTITION_EXTENDED
Definition: disk.h:60
@ PED_PARTITION_LOGICAL
Definition: disk.h:59
@ PED_PARTITION_NORMAL
Definition: disk.h:58
@ PED_PARTITION_SWAP
Definition: disk.h:72
@ PED_PARTITION_MSFT_DATA
Definition: disk.h:85
@ PED_PARTITION_PREP
Definition: disk.h:79
@ PED_PARTITION_CHROMEOS_KERNEL
Definition: disk.h:88
@ PED_PARTITION_RAID
Definition: disk.h:74
@ PED_PARTITION_BLS_BOOT
Definition: disk.h:89
@ PED_PARTITION_LINUX_HOME
Definition: disk.h:90
@ PED_PARTITION_BOOT
Definition: disk.h:70
@ PED_PARTITION_HPSERVICE
Definition: disk.h:77
@ PED_PARTITION_HIDDEN
Definition: disk.h:73
@ PED_PARTITION_MSFT_RESERVED
Definition: disk.h:80
@ PED_PARTITION_DIAG
Definition: disk.h:83
@ PED_PARTITION_NO_AUTOMOUNT
Definition: disk.h:91
@ PED_PARTITION_LVM
Definition: disk.h:75
@ PED_PARTITION_ROOT
Definition: disk.h:71
@ PED_PARTITION_ESP
Definition: disk.h:87
@ PED_PARTITION_BIOS_GRUB
Definition: disk.h:81
@ PED_PARTITION_LBA
Definition: disk.h:76
@ PED_PARTITION_LEGACY_BOOT
Definition: disk.h:84
@ PED_PARTITION_PALO
Definition: disk.h:78
@ PED_PARTITION_APPLE_TV_RECOVERY
Definition: disk.h:82
@ PED_PARTITION_IRST
Definition: disk.h:86
int ped_partition_set_name(PedPartition *part, const char *name)
Sets the name of a partition.
Definition: disk.c:1553
const char * ped_partition_type_get_name(PedPartitionType part_type)
Returns a name that seems mildly appropriate for a partition type type.
Definition: disk.c:2517
PedPartitionFlag ped_partition_flag_next(PedPartitionFlag flag)
Iterates through all flags.
Definition: disk.c:2606
void _ped_partition_free(PedPartition *part)
Definition: disk.c:1253
int ped_partition_is_active(const PedPartition *part)
Return whether or not the partition is "active".
Definition: disk.c:1366
int ped_partition_is_busy(const PedPartition *part)
Check whether a partition is mounted or busy in some other way.
Definition: disk.c:560
int ped_partition_set_type_id(PedPartition *part, uint8_t id)
Set the type-id of the partition part.
Definition: disk.c:1594
PedPartition * ped_partition_new(const PedDisk *disk, PedPartitionType type, const PedFileSystemType *fs_type, PedSector start, PedSector end)
Create a new PedPartition on disk.
Definition: disk.c:1301
void ped_partition_destroy(PedPartition *part)
Destroy a PedPartition object.
Definition: disk.c:1349
int _ped_partition_attempt_align(PedPartition *part, const PedConstraint *external, PedConstraint *internal)
Definition: disk.c:1259
uint8_t ped_partition_get_type_id(const PedPartition *part)
Get the type-id of the partition part.
Definition: disk.c:1612
PedPartition * _ped_partition_alloc(const PedDisk *disk, PedPartitionType type, const PedFileSystemType *fs_type, PedSector start, PedSector end)
Definition: disk.c:1220
int ped_partition_set_system(PedPartition *part, const PedFileSystemType *fs_type)
Sets the system type on the partition to fs_type.
Definition: disk.c:1462
int ped_partition_is_flag_available(const PedPartition *part, PedPartitionFlag flag)
Check whether a given flag is available on a partition.
Definition: disk.c:1442
const char * ped_partition_flag_get_name(PedPartitionFlag flag)
Returns a name for a flag, e.g.
Definition: disk.c:2540
uint8_t * ped_partition_get_uuid(const PedPartition *part)
Get the uuid of the partition part.
Definition: disk.c:1666
char * ped_partition_get_path(const PedPartition *part)
Return a path that can be used to address the partition in the operating system.
Definition: disk.c:572
int ped_partition_get_flag(const PedPartition *part, PedPartitionFlag flag)
Get the state (1 or 0) of a flag on a partition.
Definition: disk.c:1426
const char * ped_partition_get_name(const PedPartition *part)
Returns the name of a partition part.
Definition: disk.c:1576
int ped_partition_set_type_uuid(PedPartition *part, const uint8_t *uuid)
Set the type-uuid of the partition part.
Definition: disk.c:1630
uint8_t * ped_partition_get_type_uuid(const PedPartition *part)
Get the type-uuid of the partition part.
Definition: disk.c:1648
PedPartitionFlag ped_partition_flag_get_by_name(const char *name)
Returns the flag associated with name.
Definition: disk.c:2618
int ped_partition_set_flag(PedPartition *part, PedPartitionFlag flag, int state)
Set the state (1 or 0) of a flag on a partition.
Definition: disk.c:1393
#define __attribute(arg)
Definition: parted.h:32
char name[16]
Definition: pc98.c:13
Definition: natmath.h:56
Definition: constraint.h:29
A block device - for example, /dev/hda, not /dev/hda3.
Definition: device.h:74
Architecture-specific operations.
Definition: disk.h:297
int(* disk_commit)(PedDisk *disk)
Definition: disk.h:300
int(* partition_is_busy)(const PedPartition *part)
Definition: disk.h:299
Definition: disk.h:215
int(* partition_set_flag)(PedPartition *part, PedPartitionFlag flag, int state)
Definition: disk.h:248
int(* disk_set_flag)(PedDisk *disk, PedDiskFlag flag, int state)
Definition: disk.h:224
void(* partition_set_name)(PedPartition *part, const char *name)
Definition: disk.h:258
bool(* partition_check)(const PedPartition *part)
Definition: disk.h:272
int(* disk_is_flag_available)(const PedDisk *disk, PedDiskFlag flag)
Definition: disk.h:231
int(* probe)(const PedDevice *dev)
Definition: disk.h:217
int(* disk_get_flag)(const PedDisk *disk, PedDiskFlag flag)
Definition: disk.h:228
void(* free)(PedDisk *disk)
Definition: disk.h:221
int(* get_max_primary_partition_count)(const PedDisk *disk)
Definition: disk.h:276
int(* partition_set_type_uuid)(PedPartition *part, const uint8_t *uuid)
Definition: disk.h:264
PedSector(* max_length)(void)
Definition: disk.h:280
int(* clobber)(PedDevice *dev)
Definition: disk.h:218
int(* write)(const PedDisk *disk)
Definition: disk.h:223
int(* partition_get_flag)(const PedPartition *part, PedPartitionFlag flag)
Definition: disk.h:252
int(* alloc_metadata)(PedDisk *disk)
Definition: disk.h:275
bool(* get_max_supported_partition_count)(const PedDisk *disk, int *supported)
Definition: disk.h:277
int(* partition_enumerate)(PedPartition *part)
Definition: disk.h:271
int(* partition_set_system)(PedPartition *part, const PedFileSystemType *fs_type)
Definition: disk.h:246
int(* partition_is_flag_available)(const PedPartition *part, PedPartitionFlag flag)
Definition: disk.h:255
int(* read)(PedDisk *disk)
Definition: disk.h:222
int(* partition_set_type_id)(PedPartition *part, uint8_t id)
Definition: disk.h:261
int(* partition_align)(PedPartition *part, const PedConstraint *constraint)
Definition: disk.h:269
void(* partition_destroy)(PedPartition *part)
Definition: disk.h:245
uint8_t(* partition_get_type_id)(const PedPartition *part)
Definition: disk.h:262
PedSector(* max_start_sector)(void)
Definition: disk.h:281
Definition: disk.h:284
PedDiskOps *const ops
Definition: disk.h:288
PedDiskTypeFeature features
bitmap of supported features
Definition: disk.h:290
PedDiskType * next
Definition: disk.h:285
const char * name
the name of the partition table type.
Definition: disk.h:286
Represents a disk label (partition table).
Definition: disk.h:197
const PedDiskType * type
type of disk label
Definition: disk.h:200
int needs_clobber
clobber before write?
Definition: disk.h:209
int update_mode
mode without free/metadata partitions, for easier update
Definition: disk.h:210
void * disk_specific
Definition: disk.h:206
const int * block_sizes
block sizes supported by this label
Definition: disk.h:201
PedDevice * dev
the device where the partition table lies
Definition: disk.h:198
PedPartition * part_list
list of partitions.
Definition: disk.h:203
Structure describing type of file system.
Definition: filesys.h:46
Geometry of the partition.
Definition: geom.h:35
PedPartition structure represents a partition.
Definition: disk.h:144
PedDisk * disk
Definition: disk.h:149
PedPartitionType type
the type of partition: a bit field of PED_PARTITION_LOGICAL, PED_PARTITION_EXTENDED,...
Definition: disk.h:158
PedGeometry geom
geometry of the partition
Definition: disk.h:150
PedPartition * part_list
Definition: disk.h:182
int num
Definition: disk.h:157
const PedFileSystemType * fs_type
Only used for an extended partition.
Definition: disk.h:177
void * disk_specific
Definition: disk.h:184
PedPartition * next
the partition table of the partition
Definition: disk.h:146
PedPartition * prev
Definition: disk.h:145