summaryrefslogtreecommitdiffstats
path: root/disk-utils
diff options
context:
space:
mode:
authorKarel Zak2014-08-13 23:57:54 +0200
committerKarel Zak2014-08-13 23:57:54 +0200
commitaa36c2cf2cb331c06c1ac5950b3b70ccbf7b0111 (patch)
tree1f89cf65567e0b6037984c27c35f64788b796514 /disk-utils
parentlibfdisk: clean up API (alignment.c) (diff)
downloadkernel-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 'disk-utils')
-rw-r--r--disk-utils/cfdisk.c10
-rw-r--r--disk-utils/fdisk-menu.c10
-rw-r--r--disk-utils/fdisk.c10
3 files changed, 15 insertions, 15 deletions
diff --git a/disk-utils/cfdisk.c b/disk-utils/cfdisk.c
index 584ea9fdb..7f02c0625 100644
--- a/disk-utils/cfdisk.c
+++ b/disk-utils/cfdisk.c
@@ -1714,8 +1714,8 @@ static int main_menu_ignore_keys(struct cfdisk *cf, char *ignore,
ignore[i++] = 'b'; /* set bootable */
} else {
ignore[i++] = 'n';
- if (!fdisk_is_disklabel(cf->cxt, DOS) &&
- !fdisk_is_disklabel(cf->cxt, SGI))
+ if (!fdisk_is_label(cf->cxt, DOS) &&
+ !fdisk_is_label(cf->cxt, SGI))
ignore[i++] = 'b';
}
@@ -1765,8 +1765,8 @@ static int main_menu_action(struct cfdisk *cf, int key)
switch (key) {
case 'b': /* Bootable flag */
{
- int fl = fdisk_is_disklabel(cf->cxt, DOS) ? DOS_FLAG_ACTIVE :
- fdisk_is_disklabel(cf->cxt, SGI) ? SGI_FLAG_BOOT : 0;
+ int fl = fdisk_is_label(cf->cxt, DOS) ? DOS_FLAG_ACTIVE :
+ fdisk_is_label(cf->cxt, SGI) ? SGI_FLAG_BOOT : 0;
if (fl && fdisk_partition_toggle_flag(cf->cxt, n, fl))
warn = _("Could not toggle the flag.");
@@ -1910,7 +1910,7 @@ static int ui_run(struct cfdisk *cf)
DBG(UI, ul_debug("start COLS=%d, LINES=%d", COLS, LINES));
- if (!fdisk_dev_has_disklabel(cf->cxt) || cf->zero_start) {
+ if (!fdisk_has_label(cf->cxt) || cf->zero_start) {
rc = ui_create_label(cf);
if (rc < 0)
ui_errx(EXIT_FAILURE,
diff --git a/disk-utils/fdisk-menu.c b/disk-utils/fdisk-menu.c
index 72f8bbb08..29bc01593 100644
--- a/disk-utils/fdisk-menu.c
+++ b/disk-utils/fdisk-menu.c
@@ -555,7 +555,7 @@ static int gpt_menu_cb(struct fdisk_context **cxt0,
assert(cxt);
assert(ent);
- assert(fdisk_is_disklabel(cxt, GPT));
+ assert(fdisk_is_label(cxt, GPT));
DBG(FRONTEND, ul_debug("enter GPT menu"));
@@ -633,7 +633,7 @@ static int dos_menu_cb(struct fdisk_context **cxt0,
= fdisk_new_nested_context(cxt, "bsd");
if (!bsd)
return -ENOMEM;
- if (!fdisk_dev_has_disklabel(bsd))
+ if (!fdisk_has_label(bsd))
rc = fdisk_create_disklabel(bsd, "bsd");
if (rc)
fdisk_free_context(bsd);
@@ -689,7 +689,7 @@ static int sun_menu_cb(struct fdisk_context **cxt0,
assert(cxt);
assert(ent);
- assert(fdisk_is_disklabel(cxt, SUN));
+ assert(fdisk_is_label(cxt, SUN));
DBG(FRONTEND, ul_debug("enter SUN menu"));
@@ -744,7 +744,7 @@ static int sgi_menu_cb(struct fdisk_context **cxt0,
assert(cxt);
assert(ent);
- assert(fdisk_is_disklabel(cxt, SGI));
+ assert(fdisk_is_label(cxt, SGI));
if (ent->expert)
return rc;
@@ -784,7 +784,7 @@ static int bsd_menu_cb(struct fdisk_context **cxt0,
assert(cxt);
assert(ent);
- assert(fdisk_is_disklabel(cxt, BSD));
+ assert(fdisk_is_label(cxt, BSD));
DBG(FRONTEND, ul_debug("enter BSD menu"));
diff --git a/disk-utils/fdisk.c b/disk-utils/fdisk.c
index 5f14a7413..9d6230f70 100644
--- a/disk-utils/fdisk.c
+++ b/disk-utils/fdisk.c
@@ -459,7 +459,7 @@ void toggle_dos_compatibility_flag(struct fdisk_context *cxt)
fdisk_dos_enable_compatible(lb, flag);
- if (fdisk_is_disklabel(cxt, DOS))
+ if (fdisk_is_label(cxt, DOS))
fdisk_reset_alignment(cxt); /* reset the current label */
}
@@ -529,7 +529,7 @@ void list_disk_geometry(struct fdisk_context *cxt)
if (cxt->alignment_offset)
fdisk_info(cxt, _("Alignment offset: %lu bytes"),
cxt->alignment_offset);
- if (fdisk_dev_has_disklabel(cxt))
+ if (fdisk_has_label(cxt))
fdisk_info(cxt, _("Disklabel type: %s"), cxt->label->name);
if (fdisk_get_disklabel_id(cxt, &id) == 0 && id)
@@ -748,7 +748,7 @@ static void print_device_pt(struct fdisk_context *cxt, char *device, int warnme)
list_disk_geometry(cxt);
- if (fdisk_dev_has_disklabel(cxt))
+ if (fdisk_has_label(cxt))
list_disklabel(cxt);
}
@@ -1022,11 +1022,11 @@ int main(int argc, char **argv)
fflush(stdout);
- if (!fdisk_dev_has_disklabel(cxt)) {
+ if (!fdisk_has_label(cxt)) {
fdisk_info(cxt, _("Device does not contain a recognized partition table."));
fdisk_create_disklabel(cxt, NULL);
- } else if (fdisk_is_disklabel(cxt, GPT) && fdisk_gpt_is_hybrid(cxt))
+ } else if (fdisk_is_label(cxt, GPT) && fdisk_gpt_is_hybrid(cxt))
fdisk_warnx(cxt, _(
"A hybrid GPT was detected. You have to sync "
"the hybrid MBR manually (expert command 'M')."));