diff options
| author | Karel Zak <kzak@redhat.com> | 2013-09-03 17:35:15 +0200 |
|---|---|---|
| committer | Karel Zak <kzak@redhat.com> | 2013-09-16 16:47:09 +0200 |
| commit | c0d20aae6fb4fe5dfdb314ff11858ba2afadab67 (patch) | |
| tree | 409cb3cf16765ce13831b96441a6025501c93984 /libfdisk/src/label.c | |
| parent | 513d546289500da75d9e14a933509b7c58b1554e (diff) | |
| download | util-linux-c0d20aae6fb4fe5dfdb314ff11858ba2afadab67.tar.gz | |
libfdisk: add fdisk_locate_disklabel()
The function returns offset and size of disklabel elements.
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libfdisk/src/label.c')
| -rw-r--r-- | libfdisk/src/label.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libfdisk/src/label.c b/libfdisk/src/label.c index 147918e0..95a0abfb 100644 --- a/libfdisk/src/label.c +++ b/libfdisk/src/label.c @@ -245,6 +245,20 @@ int fdisk_create_disklabel(struct fdisk_context *cxt, const char *name) return cxt->label->op->create(cxt); } + +int fdisk_locate_disklabel(struct fdisk_context *cxt, int n, const char **name, + off_t *offset, size_t *size) +{ + if (!cxt || !cxt->label) + return -EINVAL; + if (!cxt->label->op->locate) + return -ENOSYS; + + DBG(LABEL, dbgprint("locating %d chunk of %s.", n, cxt->label->name)); + return cxt->label->op->locate(cxt, n, name, offset, size); +} + + /** * fdisk_get_disklabel_id: * @cxt: fdisk context |
