Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Sep 2012 08:30:22 +0000 (UTC)
From:      Mikolaj Golub <trociny@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r240268 - stable/8/sys/geom
Message-ID:  <201209090830.q898UMDV034318@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trociny
Date: Sun Sep  9 08:30:22 2012
New Revision: 240268
URL: http://svn.freebsd.org/changeset/base/240268

Log:
  MFC r239987 (pjd):
  
  Allow to pass providers with /dev/ prefix to g_provider_by_name().

Modified:
  stable/8/sys/geom/geom_subr.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/geom/   (props changed)

Modified: stable/8/sys/geom/geom_subr.c
==============================================================================
--- stable/8/sys/geom/geom_subr.c	Sun Sep  9 08:28:17 2012	(r240267)
+++ stable/8/sys/geom/geom_subr.c	Sun Sep  9 08:30:22 2012	(r240268)
@@ -599,6 +599,10 @@ g_error_provider(struct g_provider *pp, 
 	pp->error = error;
 }
 
+#ifndef	_PATH_DEV
+#define	_PATH_DEV	"/dev/"
+#endif
+
 struct g_provider *
 g_provider_by_name(char const *arg)
 {
@@ -606,6 +610,9 @@ g_provider_by_name(char const *arg)
 	struct g_geom *gp;
 	struct g_provider *pp;
 
+	if (strncmp(arg, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0)
+		arg += sizeof(_PATH_DEV) - 1;
+
 	LIST_FOREACH(cp, &g_classes, class) {
 		LIST_FOREACH(gp, &cp->geom, geom) {
 			LIST_FOREACH(pp, &gp->provider, provider) {
@@ -614,6 +621,7 @@ g_provider_by_name(char const *arg)
 			}
 		}
 	}
+
 	return (NULL);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209090830.q898UMDV034318>