diff options
author | Phillip Susi <psusi@ubuntu.com> | 2014-01-05 23:02:44 -0500 |
---|---|---|
committer | Phillip Susi <psusi@ubuntu.com> | 2014-05-22 19:56:36 -0400 |
commit | 7eac0588b68a4d991a0f861bb9f4553f44557e14 (patch) | |
tree | 3b31ad15458857867163f4efb88bc5fbc2c9d512 /parted/command.h | |
parent | 5adae27101565a5d6fed4aadf28ddb39872e41f5 (diff) | |
download | parted-7eac0588b68a4d991a0f861bb9f4553f44557e14.tar.gz |
parted: don't reload partition table on every command
gpt was using a static local variable to suppress repeatedly reporting
an error if you chose to ignore it. This is incorrect as the variable is
global to all disks, and ignoring the error on one should not suppress its
reporting on another. Moving the flag to the PedDisk object made it
effectively useless because parted was destroying the PedDisk and reloading
the partition table on every command.
Parted has been reworked to cache the PedDisk once loaded, and only discard
it when changing disks, or creating a new disklabel.
Diffstat (limited to 'parted/command.h')
-rw-r--r-- | parted/command.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/parted/command.h b/parted/command.h index fed7a23..0fe43aa 100644 --- a/parted/command.h +++ b/parted/command.h @@ -24,14 +24,14 @@ typedef struct { StrList* names; - int (*method) (PedDevice** dev); + int (*method) (PedDevice** dev, PedDisk** diskp); StrList* summary; StrList* help; int non_interactive:1; } Command; extern Command* command_create (const StrList* names, - int (*method) (PedDevice** dev), + int (*method) (PedDevice** dev, PedDisk** diskp), const StrList* summary, const StrList* help, int non_interactive); @@ -42,6 +42,6 @@ extern Command* command_get (Command** list, char* name); extern StrList* command_get_names (Command** list); extern void command_print_summary (Command* cmd); extern void command_print_help (Command* cmd); -extern int command_run (Command* cmd, PedDevice** dev); +extern int command_run (Command* cmd, PedDevice** dev, PedDisk** diskp); #endif /* COMMAND_H_INCLUDED */ |