[Parted-commits] GNU Parted Official Repository: Changes to 'master'

Jim Meyering meyering at alioth.debian.org
Sat Oct 1 09:13:23 UTC 2011


 .gitignore                |    7 +++++++
 include/parted/device.h   |    4 +---
 libparted/arch/linux.c    |    8 +++++---
 libparted/cs/constraint.c |    2 +-
 libparted/disk.c          |    3 ++-
 parted/parted.c           |    7 -------
 6 files changed, 16 insertions(+), 15 deletions(-)

New commits:
commit dd1277bc17e21fbf6580387c6ea96e30feac4f17
Author: Petr Uzel <petr.uzel at suse.cz>
Date:   Wed Sep 28 10:45:02 2011 +0200

    libparted: do not omit last sector when creating full-dev geometry
    
    Note that ped_constraint_solve_max() is currently not used anywhere.
    
    * libparted/cs/constraint.c (ped_constraint_solve_max): full_dev now
    really represents whole device.
    
    Signed-off-by: Petr Uzel <petr.uzel at suse.cz>

diff --git a/libparted/cs/constraint.c b/libparted/cs/constraint.c
index e0f4c4d..1dad3ed 100644
--- a/libparted/cs/constraint.c
+++ b/libparted/cs/constraint.c
@@ -449,7 +449,7 @@ ped_constraint_solve_max (const PedConstraint* constraint)
 	if (!constraint)
 		return NULL;
 	dev = constraint->start_range->dev;
-	ped_geometry_init (&full_dev, dev, 0, dev->length - 1);
+	ped_geometry_init (&full_dev, dev, 0, dev->length);
 	return ped_constraint_solve_nearest (constraint, &full_dev);
 }
 

commit 4fc048079917ba0ec38a02f93b53bed3d673df5d
Author: Petr Uzel <petr.uzel at suse.cz>
Date:   Wed Sep 28 10:45:07 2011 +0200

    maint: unmark PedDeviceType as deprecated
    
    PedDeviceType was marked as deprecated before parted started using
    git. Since it proved to be useful to differentiate between different
    device types, and nobody seems interested in removing it from the API,
    let's clear the deprecated flag.

diff --git a/include/parted/device.h b/include/parted/device.h
index b94765c..d76854a 100644
--- a/include/parted/device.h
+++ b/include/parted/device.h
@@ -29,7 +29,6 @@
 /** We can address 2^63 sectors */
 typedef long long PedSector;
 
-/** \deprecated Removal from API planned */
 typedef enum {
         PED_DEVICE_UNKNOWN      = 0,
         PED_DEVICE_SCSI         = 1,
@@ -75,8 +74,7 @@ struct _PedDevice {
                                              (manufacturer, model) */
         char*           path;           /**< device /dev entry */
 
-        PedDeviceType   type;           /**< SCSI, IDE, etc.
-                                             \deprecated \sa PedDeviceType */
+        PedDeviceType   type;           /**< SCSI, IDE, etc. \sa PedDeviceType */
         long long       sector_size;            /**< logical sector size */
         long long       phys_sector_size;       /**< physical sector size */
         PedSector       length;                 /**< device length (LBA) */

commit cf35ba6ba80027bc35805782db64513d1a2b77a3
Author: Petr Uzel <petr.uzel at suse.cz>
Date:   Wed Sep 28 10:45:08 2011 +0200

    libparted: do not call _device_get_partition_range() twice
    
    PED_MIN can evaluate its arguments twice.
    
    * libparted/arch/linux.c (_disk_sync_part_table): Call
    _device_get_partition_range() outside PED_MIN.

diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index 3d1460d..ab3d904 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -2521,11 +2521,13 @@ _disk_sync_part_table (PedDisk* disk)
         PED_ASSERT(disk->dev != NULL);
         int lpn;
 
+        unsigned int part_range = _device_get_partition_range(disk->dev);
+
         /* lpn = largest partition number. */
         if (ped_disk_get_max_supported_partition_count(disk, &lpn))
-                lpn = PED_MIN(lpn, _device_get_partition_range(disk->dev));
+                lpn = PED_MIN(lpn, part_range);
         else
-                lpn = _device_get_partition_range(disk->dev);
+                lpn = part_range;
 
         /* Its not possible to support largest_partnum < 0.
          * largest_partnum == 0 would mean does not support partitions.

commit ce59e872861a48ad3ec8353af3301bcc9ad1ef90
Author: Petr Uzel <petr.uzel at suse.cz>
Date:   Wed Sep 28 10:45:09 2011 +0200

    libparted: optimize _disk_sync_part_table
    
    In _disk_sync_part_table, if the largest partition number (lpn) is 0,
    it does not make sense to go through the loops below.  Return
    immediately instead.
    * libparted/arch/linux.c (_disk_sync_part_table): Return immediately
    if lpn == 0.

diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index b1c12b5..3d1460d 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -2530,7 +2530,7 @@ _disk_sync_part_table (PedDisk* disk)
         /* Its not possible to support largest_partnum < 0.
          * largest_partnum == 0 would mean does not support partitions.
          * */
-        if (lpn < 0)
+        if (lpn < 1)
                 return 0;
         int ret = 0;
         int *ok = calloc (lpn, sizeof *ok);

commit 4fafca5d9337b1a5504ad9256c6d1aa5cdec0f2b
Author: Petr Uzel <petr.uzel at suse.cz>
Date:   Wed Sep 28 10:45:03 2011 +0200

    build: ignore more generated files

diff --git a/.gitignore b/.gitignore
index 04d5c5c..5937e5b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,6 +38,8 @@ libparted/tests/init.sh
 libparted/tests/label
 libparted/tests/t*.sh.log
 libparted/tests/test-suite.log
+libparted/tests/symlink
+libparted/tests/zerolen
 libtool
 m4
 maint.mk
@@ -46,11 +48,16 @@ parted-*.tar.bz2.sig
 parted-*.tar.gz
 parted-*.tar.gz.sig
 parted.spec
+parted/version.c
+parted/version.h
 partprobe/partprobe
 po/.reference
 stamp-h1
 tags
+tests/dup-clobber
+tests/help-version.log
 tests/old-init.sh
 tests/print-align
+tests/print-max
 tests/t*.sh.log
 tests/test-suite.log

commit 564e41ff6b452e5f281a072f0a86a361dd9df9a0
Author: Petr Uzel <petr.uzel at suse.cz>
Date:   Wed Sep 28 10:45:06 2011 +0200

    parted: remove obsolete comments
    
    is_start_exact and is_end_exact were removed from the source.
    * parted/parted.c (constraint_from_start_end): Remove obsolete
    documentation of the function.

diff --git a/parted/parted.c b/parted/parted.c
index 51ecdaf..bc14322 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -425,13 +425,6 @@ snap_to_boundaries (PedGeometry* new_geom, PedGeometry* old_geom,
         ped_geometry_set (new_geom, start, end - start + 1);
 }
 
-/* This functions constructs a constraint from the following information:
- *      start, is_start_exact, end, is_end_exact.
- *
- * If is_start_exact == 1, then the constraint requires start be as given in
- * "start".  Otherwise, the constraint does not set any requirements on the
- * start.
- */
 static PedConstraint*
 constraint_from_start_end (PedDevice* dev, PedGeometry* range_start,
                            PedGeometry* range_end)

commit f9721d0bf4135dae0c8cc5d10e149b290c87039e
Author: Petr Uzel <petr.uzel at suse.cz>
Date:   Wed Sep 28 10:45:05 2011 +0200

    libparted: check return value from ped_geometry_init
    
    If ped_geometry_init() failed in ped_disk_set_partition_geom(),
    then new_geom remains uninitialized, but still later used, which
    leads to unexpected results.
    * libparted/disk.c (ped_disk_set_partition_geom): Check return
    value from ped_geometry_init().

diff --git a/libparted/disk.c b/libparted/disk.c
index 1057aa8..807b53a 100644
--- a/libparted/disk.c
+++ b/libparted/disk.c
@@ -2171,7 +2171,8 @@ ped_disk_set_partition_geom (PedDisk* disk, PedPartition* part,
 	PED_ASSERT (part->disk == disk);
 
 	old_geom = part->geom;
-	ped_geometry_init (&new_geom, part->geom.dev, start, end - start + 1);
+	if (!ped_geometry_init (&new_geom, part->geom.dev, start, end - start + 1))
+		return 0;
 
 	if (!_disk_push_update_mode (disk))
 		return 0;



More information about the Parted-commits mailing list