diff options
author | Davidlohr Bueso | 2012-07-08 23:40:27 +0200 |
---|---|---|
committer | Karel Zak | 2012-07-16 17:59:52 +0200 |
commit | b8855c868fce518d5f7c0aafb63accf99506643c (patch) | |
tree | 37e8cdbf301804d37b0822cd05202dba24b70bf3 /fdisks/fdiskdoslabel.c | |
parent | build-sys: add -Werror to UL_WARN_ADD test (diff) | |
download | kernel-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.c | 8 |
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, +}; |