diff options
author | Karel Zak | 2014-02-03 14:40:27 +0100 |
---|---|---|
committer | Karel Zak | 2014-03-11 11:35:14 +0100 |
commit | 036439315f4c29748fddd10c33d6cc4868dd9352 (patch) | |
tree | b835ad35c81cab7e2434f04edbecdaa48a007703 /libfdisk/src/partition.c | |
parent | libfdisk: don't ask for pri/log if wanted start within extended partition (diff) | |
download | kernel-qcow2-util-linux-036439315f4c29748fddd10c33d6cc4868dd9352.tar.gz kernel-qcow2-util-linux-036439315f4c29748fddd10c33d6cc4868dd9352.tar.xz kernel-qcow2-util-linux-036439315f4c29748fddd10c33d6cc4868dd9352.zip |
libfdisk: improve freesapce detection
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libfdisk/src/partition.c')
-rw-r--r-- | libfdisk/src/partition.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libfdisk/src/partition.c b/libfdisk/src/partition.c index da5e75c25..20993ba3a 100644 --- a/libfdisk/src/partition.c +++ b/libfdisk/src/partition.c @@ -72,13 +72,12 @@ int fdisk_partition_cmp_start(struct fdisk_partition *a, return a->start - b->start; } -int fdisk_partition_set_end(struct fdisk_partition *pa, uint64_t off, int isrel) +int fdisk_partition_set_end(struct fdisk_partition *pa, uint64_t off) { if (!pa) return -EINVAL; pa->end = off; pa->size = 0; - pa->endrel = isrel ? 1 : 0; return 0; } @@ -220,6 +219,15 @@ int fdisk_partition_is_nested(struct fdisk_partition *pa) return pa && pa->nested; } +int fdisk_partition_get_parent(struct fdisk_partition *pa, size_t *parent) +{ + if (pa && parent) + *parent = pa->parent_partno; + else + return -EINVAL; + return 0; +} + int fdisk_partition_is_used(struct fdisk_partition *pa) { return pa && pa->used; |