Date: Mon, 15 Apr 2013 15:55:40 +0000 (UTC) From: Ivan Voras <ivoras@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249507 - head/sys/geom Message-ID: <201304151555.r3FFtebI075592@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ivoras Date: Mon Apr 15 15:55:40 2013 New Revision: 249507 URL: http://svnweb.freebsd.org/changeset/base/249507 Log: Introduce a symbol for the GEOM class name instead of using the ad-hoc string constant. Modified: head/sys/geom/geom_disk.c head/sys/geom/geom_disk.h head/sys/geom/geom_dump.c Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Mon Apr 15 13:00:42 2013 (r249506) +++ head/sys/geom/geom_disk.c Mon Apr 15 15:55:40 2013 (r249507) @@ -75,7 +75,7 @@ static g_dumpconf_t g_disk_dumpconf; static g_provgone_t g_disk_providergone; static struct g_class g_disk_class = { - .name = "DISK", + .name = G_DISK_CLASS_NAME, .version = G_VERSION, .start = g_disk_start, .access = g_disk_access, Modified: head/sys/geom/geom_disk.h ============================================================================== --- head/sys/geom/geom_disk.h Mon Apr 15 13:00:42 2013 (r249506) +++ head/sys/geom/geom_disk.h Mon Apr 15 15:55:40 2013 (r249507) @@ -44,6 +44,8 @@ #include <sys/_mutex.h> #include <sys/disk.h> +#define G_DISK_CLASS_NAME "DISK" + struct disk; typedef int disk_open_t(struct disk *); Modified: head/sys/geom/geom_dump.c ============================================================================== --- head/sys/geom/geom_dump.c Mon Apr 15 13:00:42 2013 (r249506) +++ head/sys/geom/geom_dump.c Mon Apr 15 15:55:40 2013 (r249507) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include <geom/geom.h> #include <geom/geom_int.h> +#include <geom/geom_disk.h> static void @@ -146,7 +147,7 @@ g_conftxt(void *p, int flag) sb = p; g_topology_assert(); LIST_FOREACH(mp, &g_classes, class) { - if (!strcmp(mp->name, "DISK") || !strcmp(mp->name, "MD")) + if (!strcmp(mp->name, G_DISK_CLASS_NAME) || !strcmp(mp->name, "MD")) g_conftxt_class(sb, mp); } sbuf_finish(sb);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201304151555.r3FFtebI075592>