GNU bug report logs - #16370
[PATCH] parted: don't reload partition table on every command

Previous Next

Package: parted;

Reported by: Phillip Susi <psusi <at> ubuntu.com>

Date: Mon, 6 Jan 2014 04:05:02 UTC

Severity: normal

Tags: patch

Done: Phillip Susi <psusi <at> ubuntu.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Brian C. Lane" <bcl <at> redhat.com>
To: 16370 <at> debbugs.gnu.org
Subject: bug#16370: [PATCH] parted: don't reload partition table on every command
Date: Mon, 3 Mar 2014 12:06:43 -0800
On Sun, Jan 05, 2014 at 11:03:55PM -0500, Phillip Susi wrote:
>  Command*
>  command_create (const StrList* names,
> -		int (*method) (PedDevice** dev),
> +		int (*method) (PedDevice** dev, PedDisk** disk),

May as well call the argument diskp everywhere to be consistent.

> @@ -1274,11 +1270,15 @@ static int
>  _print_list ()
>  {
>          PedDevice *current_dev = NULL;
> +        PedDisk *disk = 0;

Why do you use 0 instead of NULL? To me seeing a 0 makes me think it is
supposed to have a value whereas NULL makes it clear it is
uninitialized.

> -        disk = ped_disk_new (*dev);
> -        if (!disk)
> +        if (*disk == 0)

No need to use == 0 here.

>  static void
> -_done (PedDevice* dev)
> +_done (PedDevice* dev, PedDisk* disk)
>  {
> +if (disk)
> +        ped_disk_destroy (disk);
>  if (dev->boot_dirty && dev->type != PED_DEVICE_FILE) {
>          ped_exception_throw (
>                  PED_EXCEPTION_WARNING,

Looks like _done could use some indentation fixes, may as well clean it
up while you're changing it.

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)




This bug report was last modified 11 years and 54 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.