summaryrefslogtreecommitdiffstats
path: root/libfdisk/src/alignment.c
diff options
context:
space:
mode:
authorKarel Zak2018-09-12 13:18:08 +0200
committerKarel Zak2018-09-12 13:26:18 +0200
commite4386c8cc0f7f2cfb09781d963b353310a3cd93a (patch)
treee91a483ea75563bc4bd3a2b9faaceefec3fafac0 /libfdisk/src/alignment.c
parentsfdisk: document script GPT headers (diff)
downloadkernel-qcow2-util-linux-e4386c8cc0f7f2cfb09781d963b353310a3cd93a.tar.gz
kernel-qcow2-util-linux-e4386c8cc0f7f2cfb09781d963b353310a3cd93a.tar.xz
kernel-qcow2-util-linux-e4386c8cc0f7f2cfb09781d963b353310a3cd93a.zip
libfdisk: accept grain script header
The "grain" variable is used to calculate partitions alignment. The default is 1MiB (or minimal I/O size). The libfdisk provides API to overwrite this default, but this feature has been nowhere accessible for end-user. This patch support for "grain: <size>" in libfdisk scripts. Addresses: https://github.com/karelzak/util-linux/issues/688 Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libfdisk/src/alignment.c')
-rw-r--r--libfdisk/src/alignment.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libfdisk/src/alignment.c b/libfdisk/src/alignment.c
index 891285aaa..a238c7bf0 100644
--- a/libfdisk/src/alignment.c
+++ b/libfdisk/src/alignment.c
@@ -338,6 +338,7 @@ int fdisk_save_user_grain(struct fdisk_context *cxt, unsigned long grain)
if (!cxt || grain % 512)
return -EINVAL;
+ DBG(CXT, ul_debugobj(cxt, "user grain size: %lu", grain));
cxt->user_grain = grain;
return 0;
}