diff options
author | marcel <marcel@FreeBSD.org> | 2008-04-23 20:13:05 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2008-04-23 20:13:05 +0000 |
commit | 38e8adf72053670c84a15fd57d641357ec1d4501 (patch) | |
tree | 0e7bf464079f7c3553cf6f191b95c9772ae66018 /sys/geom/part/g_part_apm.c | |
parent | f7fcfdc595633492f520f12db8f7447003ab54b3 (diff) | |
download | FreeBSD-src-38e8adf72053670c84a15fd57d641357ec1d4501.zip FreeBSD-src-38e8adf72053670c84a15fd57d641357ec1d4501.tar.gz |
Implement the G_PART_DUMPCONF method for all 6 schemes. Also call
the method for the (indent == NULL) case (i.e. the kern.geom.conftxt
sysctl). The purpose is to extend the conftxt output with scheme-
specific fields which can be used by libdisk. In particular, have
the schemes dump the xs and xt fields, which contain the backward
compatible values for class type and partition type. This allows
libdisk to work with the legacy slicers as well as with gpart and
helps/promotes migration.
Diffstat (limited to 'sys/geom/part/g_part_apm.c')
-rw-r--r-- | sys/geom/part/g_part_apm.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sys/geom/part/g_part_apm.c b/sys/geom/part/g_part_apm.c index 3b4ec73..34647c3 100644 --- a/sys/geom/part/g_part_apm.c +++ b/sys/geom/part/g_part_apm.c @@ -61,6 +61,8 @@ static int g_part_apm_add(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); static int g_part_apm_create(struct g_part_table *, struct g_part_parms *); static int g_part_apm_destroy(struct g_part_table *, struct g_part_parms *); +static int g_part_apm_dumpconf(struct g_part_table *, struct g_part_entry *, + struct sbuf *, const char *); static int g_part_apm_dumpto(struct g_part_table *, struct g_part_entry *); static int g_part_apm_modify(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); @@ -76,6 +78,7 @@ static kobj_method_t g_part_apm_methods[] = { KOBJMETHOD(g_part_add, g_part_apm_add), KOBJMETHOD(g_part_create, g_part_apm_create), KOBJMETHOD(g_part_destroy, g_part_apm_destroy), + KOBJMETHOD(g_part_dumpconf, g_part_apm_dumpconf), KOBJMETHOD(g_part_dumpto, g_part_apm_dumpto), KOBJMETHOD(g_part_modify, g_part_apm_modify), KOBJMETHOD(g_part_name, g_part_apm_name), @@ -229,6 +232,20 @@ g_part_apm_destroy(struct g_part_table *basetable, struct g_part_parms *gpp) } static int +g_part_apm_dumpconf(struct g_part_table *table, struct g_part_entry *baseentry, + struct sbuf *sb, const char *indent) +{ + struct g_part_apm_entry *entry; + + if (indent != NULL) + return (0); + + entry = (struct g_part_apm_entry *)baseentry; + sbuf_printf(sb, " xs APPLE xt %s", entry->ent.ent_type); + return (0); +} + +static int g_part_apm_dumpto(struct g_part_table *table, struct g_part_entry *baseentry) { struct g_part_apm_entry *entry; |