diff options
author | mav <mav@FreeBSD.org> | 2014-05-08 12:07:40 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2014-05-08 12:07:40 +0000 |
commit | df9f601cbcdbfe062c43e38da3dd1a4351c46fdf (patch) | |
tree | 40fa3a9c7ec23e561339796d3792157d5630df85 /sys/geom/raid/md_sii.c | |
parent | 69f94d7a6b01beaadc4c8acbcabcada8e4c9291f (diff) | |
download | FreeBSD-src-df9f601cbcdbfe062c43e38da3dd1a4351c46fdf.zip FreeBSD-src-df9f601cbcdbfe062c43e38da3dd1a4351c46fdf.tar.gz |
MFC r265054:
Reduce number of opens by REOM RAID during provider taste.
Instead opening/closing provider by each of metadata classes, do it only
once in core code. Since for SCSI disks open/close means sending some
SCSI commands to the device, this change reduces taste time.
Sponsored by: iXsystems, Inc.
Diffstat (limited to 'sys/geom/raid/md_sii.c')
-rw-r--r-- | sys/geom/raid/md_sii.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/geom/raid/md_sii.c b/sys/geom/raid/md_sii.c index 149b336..5012dc5 100644 --- a/sys/geom/raid/md_sii.c +++ b/sys/geom/raid/md_sii.c @@ -923,15 +923,12 @@ g_raid_md_taste_sii(struct g_raid_md_object *md, struct g_class *mp, /* Read metadata from device. */ meta = NULL; vendor = 0xffff; - if (g_access(cp, 1, 0, 0) != 0) - return (G_RAID_MD_TASTE_FAIL); g_topology_unlock(); len = 2; if (pp->geom->rank == 1) g_io_getattr("GEOM::hba_vendor", cp, &len, &vendor); meta = sii_meta_read(cp); g_topology_lock(); - g_access(cp, -1, 0, 0); if (meta == NULL) { if (g_raid_aggressive_spare) { if (vendor == 0x1095) { @@ -1011,6 +1008,9 @@ search: G_RAID_DEBUG1(1, sc, "root_mount_hold %p", mdi->mdio_rootmount); } + /* There is no return after this point, so we close passed consumer. */ + g_access(cp, -1, 0, 0); + rcp = g_new_consumer(geom); rcp->flags |= G_CF_DIRECT_RECEIVE; g_attach(rcp, pp); |