diff options
author | Karel Zak | 2017-05-09 14:30:02 +0200 |
---|---|---|
committer | Karel Zak | 2017-05-09 14:30:02 +0200 |
commit | 29f2e825d8a92fb45469098874691666e5e4e2a0 (patch) | |
tree | c3d531b241ac667e8e1a01e6b1213037aaefcdd8 /libfdisk/src/partition.c | |
parent | fdisk: add to the man page missing option (diff) | |
download | kernel-qcow2-util-linux-29f2e825d8a92fb45469098874691666e5e4e2a0.tar.gz kernel-qcow2-util-linux-29f2e825d8a92fb45469098874691666e5e4e2a0.tar.xz kernel-qcow2-util-linux-29f2e825d8a92fb45469098874691666e5e4e2a0.zip |
libfdisk: add fdisk_partition_has_wipe()
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libfdisk/src/partition.c')
-rw-r--r-- | libfdisk/src/partition.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libfdisk/src/partition.c b/libfdisk/src/partition.c index 4017096a8..2a518d365 100644 --- a/libfdisk/src/partition.c +++ b/libfdisk/src/partition.c @@ -1309,6 +1309,19 @@ int fdisk_wipe_partition(struct fdisk_context *cxt, size_t partno, int enable) return rc < 0 ? rc : 0; } +/** + * fdisk_partition_has_wipe: + * @cxt: fdisk context + * @pa: partition + * + * Returns: 1 if the area specified by @pa will be wiped by write command, or 0. + */ +int fdisk_partition_has_wipe(struct fdisk_context *cxt, struct fdisk_partition *pa) +{ + return fdisk_has_wipe_area(cxt, fdisk_partition_get_start(pa), + fdisk_partition_get_size(pa)); +} + /** * fdisk_add_partition: |