diff options
author | Karel Zak | 2017-07-14 10:51:14 +0200 |
---|---|---|
committer | Karel Zak | 2017-07-14 11:34:55 +0200 |
commit | 1dd63a3b05acd7640c688f9535508417fac950d1 (patch) | |
tree | 245abf4c0da52ec0d169dddd558b960e10526c7b /libfdisk/src/fdiskP.h | |
parent | partx: move partx.h to include/ (diff) | |
download | kernel-qcow2-util-linux-1dd63a3b05acd7640c688f9535508417fac950d1.tar.gz kernel-qcow2-util-linux-1dd63a3b05acd7640c688f9535508417fac950d1.tar.xz kernel-qcow2-util-linux-1dd63a3b05acd7640c688f9535508417fac950d1.zip |
libfdisk: use BLKPG ioctls to inform kernel about changes
This patch introduces fdisk_reread_changes(). The function is
less invasive alternative to fdisk_reread_partition_table().
The new function uses BLKPG ioctls for modified partitions. The
another partitions are not affected. This solution allows to
successfully use fdisks on disk where some partitions are still use
(mounted). For example if you want to resize the last partition on the
device.
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libfdisk/src/fdiskP.h')
-rw-r--r-- | libfdisk/src/fdiskP.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libfdisk/src/fdiskP.h b/libfdisk/src/fdiskP.h index eec3ea877..434490edd 100644 --- a/libfdisk/src/fdiskP.h +++ b/libfdisk/src/fdiskP.h @@ -412,6 +412,17 @@ struct fdisk_context { struct fdisk_script *script; /* what we want to follow */ }; +/* table */ +enum { + FDISK_DIFF_UNCHANGED = 0, + FDISK_DIFF_REMOVED, + FDISK_DIFF_ADDED, + FDISK_DIFF_MOVED, + FDISK_DIFF_RESIZED +}; +extern int fdisk_diff_tables(struct fdisk_table *a, struct fdisk_table *b, + struct fdisk_iter *itr, + struct fdisk_partition **res, int *change); /* context.c */ extern int __fdisk_switch_label(struct fdisk_context *cxt, |