diff options
author | mav <mav@FreeBSD.org> | 2013-04-05 13:11:28 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2013-04-05 13:11:28 +0000 |
commit | 9414459699f1fec0c072d9fba0b3c751e9847175 (patch) | |
tree | ee31fc71d76b138f1cbf0c30cb6c0b7e415ba125 /sys/geom | |
parent | d39a4f6fc927b5d2d6789687ddb9a60818cb7a78 (diff) | |
download | FreeBSD-src-9414459699f1fec0c072d9fba0b3c751e9847175.zip FreeBSD-src-9414459699f1fec0c072d9fba0b3c751e9847175.tar.gz |
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
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/geom_disk.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c index af0316a..c71e6ec 100644 --- a/sys/geom/geom_disk.c +++ b/sys/geom/geom_disk.c @@ -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); + } } } |