summaryrefslogtreecommitdiffstats
path: root/fdisks/fdiskdoslabel.c
diff options
context:
space:
mode:
authorDavidlohr Bueso2012-07-08 23:40:27 +0200
committerKarel Zak2012-07-16 17:59:52 +0200
commitb8855c868fce518d5f7c0aafb63accf99506643c (patch)
tree37e8cdbf301804d37b0822cd05202dba24b70bf3 /fdisks/fdiskdoslabel.c
parentbuild-sys: add -Werror to UL_WARN_ADD test (diff)
downloadkernel-qcow2-util-linux-b8855c868fce518d5f7c0aafb63accf99506643c.tar.gz
kernel-qcow2-util-linux-b8855c868fce518d5f7c0aafb63accf99506643c.tar.xz
kernel-qcow2-util-linux-b8855c868fce518d5f7c0aafb63accf99506643c.zip
fdisk: API: add label probing functionality
This patch sets the initial layout for label specific operations. A new fdisk_label structure is created that will hold all these ops, like new, delete, write and probe, among others. For now only probing is implemented. Once this design is established, a copy of the probed label will be copied to the main context structure, where calling the specific functions will save 'disklabel' checks. Debugging support is added as well. This patch passes regression tests and manually passes bsd, sun, dos and sgi labels probes. Reviewed-by: Petr Uzel <petr.uzel@suse.cz> Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Diffstat (limited to 'fdisks/fdiskdoslabel.c')
-rw-r--r--fdisks/fdiskdoslabel.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fdisks/fdiskdoslabel.c b/fdisks/fdiskdoslabel.c
index a72a432c1..27536da38 100644
--- a/fdisks/fdiskdoslabel.c
+++ b/fdisks/fdiskdoslabel.c
@@ -316,7 +316,7 @@ void dos_delete_partition(int i)
}
}
-int check_dos_label(struct fdisk_context *cxt)
+static int check_dos_label(struct fdisk_context *cxt)
{
int i;
@@ -680,3 +680,9 @@ void dos_write_table(struct fdisk_context *cxt)
}
}
}
+
+const struct fdisk_label dos_label =
+{
+ .name = "dos",
+ .probe = check_dos_label,
+};