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
This commit is contained in:
mav 2013-04-05 13:11:28 +00:00
parent d39a4f6fc9
commit 9414459699

View File

@ -658,8 +658,12 @@ disk_media_changed(struct disk *dp, int flag)
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 flag)
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);
}
}
}