summaryrefslogtreecommitdiffstats
path: root/libfdisk/src/context.c
diff options
context:
space:
mode:
authorKarel Zak2014-08-28 13:03:23 +0200
committerKarel Zak2014-08-28 13:03:23 +0200
commit62a9ef3e2f54d61fc5c6921c48f8ac3fe40ee5be (patch)
treef28caab0624c9189b82eeeb278a372ec5b946e9b /libfdisk/src/context.c
parentlibfdisk: use reference counting for context (diff)
downloadkernel-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.c12
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")