diff options
author | Karel Zak | 2014-08-28 13:03:23 +0200 |
---|---|---|
committer | Karel Zak | 2014-08-28 13:03:23 +0200 |
commit | 62a9ef3e2f54d61fc5c6921c48f8ac3fe40ee5be (patch) | |
tree | f28caab0624c9189b82eeeb278a372ec5b946e9b /libfdisk/src/context.c | |
parent | libfdisk: use reference counting for context (diff) | |
download | kernel-qcow2-util-linux-62a9ef3e2f54d61fc5c6921c48f8ac3fe40ee5be.tar.gz kernel-qcow2-util-linux-62a9ef3e2f54d61fc5c6921c48f8ac3fe40ee5be.tar.xz kernel-qcow2-util-linux-62a9ef3e2f54d61fc5c6921c48f8ac3fe40ee5be.zip |
libfdisk: add reference to context to dump
* add fdisk_ref_context() function
* context is necessary to parse label specific partition types
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libfdisk/src/context.c')
-rw-r--r-- | libfdisk/src/context.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libfdisk/src/context.c b/libfdisk/src/context.c index caeec231b..2dcb1fc21 100644 --- a/libfdisk/src/context.c +++ b/libfdisk/src/context.c @@ -132,6 +132,18 @@ struct fdisk_context *fdisk_new_nested_context(struct fdisk_context *parent, /** + * fdisk_ref_context: + * @cxt: context pointer + * + * Incremparts reference counter. + */ +void fdisk_ref_context(struct fdisk_context *cxt) +{ + if (cxt) + cxt->refcount++; +} + +/** * fdisk_get_label: * @cxt: context instance * @name: label name (e.g. "gpt") |