FreeBSD/sys/geom/mirror/g_mirror.c
/*
 * Find a disk in mirror by its disk ID.
 */
Find a disk in mirror by its disk ID.
Find a disk in mirror by its disk ID .
static struct g_mirror_disk *
g_mirror_id2disk(struct g_mirror_softc *sc, uint32_t id)
{
	struct g_mirror_disk *disk;
	sx_assert(&sc->sc_lock, SX_XLOCKED);
	LIST_FOREACH(disk, &sc->sc_disks, d_next) {
		if (disk->d_id == id)
			return (disk);
	}
	return (NULL);
}
static struct g_mirror_disk * g_mirror_id2disk ( struct g_mirror_softc * sc , uint32_t id ) { struct g_mirror_disk * disk ; sx_assert ( & sc -> sc_lock , SX_XLOCKED ) ; LIST_FOREACH ( disk , & sc -> sc_disks , d_next ) { if ( disk -> d_id == id ) return ( disk ) ; } return ( NULL ) ; }
Find a disk in mirror by its disk ID.
Find a disk in mirror by its disk ID .