svn commit: r249161 - head/sys/geom
Alexander Motin
mav at FreeBSD.org
Fri Apr 5 13:11:29 UTC 2013
Author: mav
Date: Fri Apr 5 13:11:28 2013
New Revision: 249161
URL: http://svnweb.freebsd.org/changeset/base/249161
Log:
Following r241022, replace iteration over the provider list on media events
by taking first one and asserting that there is no others.
MFC after: 1 week
Modified:
head/sys/geom/geom_disk.c
Modified: head/sys/geom/geom_disk.c
==============================================================================
--- head/sys/geom/geom_disk.c Fri Apr 5 11:57:41 2013 (r249160)
+++ head/sys/geom/geom_disk.c Fri Apr 5 13:11:28 2013 (r249161)
@@ -658,8 +658,12 @@ disk_media_changed(struct disk *dp, int
gp = dp->d_geom;
if (gp != NULL) {
- LIST_FOREACH(pp, &gp->provider, provider)
+ pp = LIST_FIRST(&gp->provider);
+ if (pp != NULL) {
+ KASSERT(LIST_NEXT(pp, provider) == NULL,
+ ("geom %p has more than one provider", gp));
g_media_changed(pp, flag);
+ }
}
}
@@ -671,8 +675,12 @@ disk_media_gone(struct disk *dp, int fla
gp = dp->d_geom;
if (gp != NULL) {
- LIST_FOREACH(pp, &gp->provider, provider)
+ pp = LIST_FIRST(&gp->provider);
+ if (pp != NULL) {
+ KASSERT(LIST_NEXT(pp, provider) == NULL,
+ ("geom %p has more than one provider", gp));
g_media_gone(pp, flag);
+ }
}
}
More information about the svn-src-head
mailing list