diff options
author | Karel Zak | 2014-08-13 23:57:54 +0200 |
---|---|---|
committer | Karel Zak | 2014-08-13 23:57:54 +0200 |
commit | aa36c2cf2cb331c06c1ac5950b3b70ccbf7b0111 (patch) | |
tree | 1f89cf65567e0b6037984c27c35f64788b796514 /libfdisk/src/label.c | |
parent | libfdisk: clean up API (alignment.c) (diff) | |
download | kernel-qcow2-util-linux-aa36c2cf2cb331c06c1ac5950b3b70ccbf7b0111.tar.gz kernel-qcow2-util-linux-aa36c2cf2cb331c06c1ac5950b3b70ccbf7b0111.tar.xz kernel-qcow2-util-linux-aa36c2cf2cb331c06c1ac5950b3b70ccbf7b0111.zip |
libfdisk: cleanup fdisk_is_label stuff
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libfdisk/src/label.c')
-rw-r--r-- | libfdisk/src/label.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/libfdisk/src/label.c b/libfdisk/src/label.c index 65a5cde25..36e4688d9 100644 --- a/libfdisk/src/label.c +++ b/libfdisk/src/label.c @@ -1,6 +1,7 @@ #include "fdiskP.h" + /* * Don't use this function derectly */ @@ -12,7 +13,7 @@ int fdisk_probe_labels(struct fdisk_context *cxt) for (i = 0; i < cxt->nlabels; i++) { struct fdisk_label *lb = cxt->labels[i]; - struct fdisk_label *org = cxt->label; + struct fdisk_label *org = fdisk_get_label(cxt, NULL); int rc; if (!lb->op->probe) @@ -41,29 +42,17 @@ int fdisk_probe_labels(struct fdisk_context *cxt) return 1; /* not found */ } - /** - * fdisk_dev_has_disklabel: - * @cxt: fdisk context + * fdisk_label_get_name: + * @lb: label * - * Returns: return 1 if there is label on the device. + * Returns: label name */ -int fdisk_dev_has_disklabel(struct fdisk_context *cxt) +const char *fdisk_label_get_name(struct fdisk_label *lb) { - return cxt && cxt->label; + return lb ? lb->name : NULL; } -/** - * fdisk_dev_is_disklabel: - * @cxt: fdisk context - * @l: disklabel type - * - * Returns: return 1 if there is @l disklabel on the device. - */ -int fdisk_dev_is_disklabel(struct fdisk_context *cxt, enum fdisk_labeltype l) -{ - return cxt && cxt->label && cxt->label->id == l; -} /** * fdisk_write_disklabel: |