]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libfdisk: don't count special whole-disk partitions
authorKarel Zak <kzak@redhat.com>
Fri, 7 Mar 2014 12:43:39 +0000 (13:43 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 11 Mar 2014 10:35:15 +0000 (11:35 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk/src/fdiskP.h
libfdisk/src/table.c

index 6d067fbf5e9b4c345722555f136d15686be4b050..cde75c1fa430ffb1e086107b523ebb0bd801e198 100644 (file)
@@ -189,6 +189,7 @@ struct fdisk_partition {
                        end_follow_default : 1,         /* use default end */
                        freespace : 1,          /* this is free space */
                        container : 1,          /* container partition (e.g. extended partition) */
+                       wholedisk : 1,          /* special system partition */
                        used   : 1;             /* partition already used */
 };
 
index ae1a2cf5de975add5cebadb1ad89473e04c888b0..dfa5dc80e4cde4cfa3fa6479bf77abe186ae7968 100644 (file)
@@ -486,7 +486,7 @@ int fdisk_get_freespaces(struct fdisk_context *cxt, struct fdisk_table **tb)
 
        /* analyze gaps between partitions */
        while (rc == 0 && fdisk_table_next_partition(parts, &itr, &pa) == 0) {
-               if (!pa->used || fdisk_partition_is_nested(pa))
+               if (!pa->used || pa->wholedisk || fdisk_partition_is_nested(pa))
                        continue;
                DBG(LABEL, dbgprint("freespace analyze: partno=%zu, start=%ju, end=%ju",
                                        pa->partno, pa->start, pa->end));