Date: Wed, 14 Jul 2010 14:40:05 GMT From: Jimmy Olgeni <olgeni@FreeBSD.org> To: freebsd-fs@FreeBSD.org Subject: Re: bin/148296: [zfs] [loader] [patch] Very slow probe in /usr/src/sys/boot/zfs/zfs.c Message-ID: <201007141440.o6EEe5QP091926@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/148296; it has been noted by GNATS.
From: Jimmy Olgeni <olgeni@FreeBSD.org>
To: Andriy Gapon <avg@FreeBSD.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: bin/148296: [zfs] [loader] [patch] Very slow probe in
/usr/src/sys/boot/zfs/zfs.c
Date: Wed, 14 Jul 2010 16:15:49 +0200 (CEST)
Hello,
This should do it, but I don't have the right configuration to test it
now. However, the "else continue" should bail out of the loop if a
vdev was spotted in the top level device.
--- zfs.c.orig 2010-06-14 04:09:06.000000000 +0200
+++ zfs.c 2010-07-14 16:04:49.808159404 +0200
@@ -412,16 +412,23 @@
*/
if (vdev_probe(vdev_read, (void*) (uintptr_t) fd, 0))
close(fd);
+ else
+ continue;
+
+ for (slice = 1; slice <= 4; slice++) {
+ sprintf(devname, "disk%ds%d:", unit, slice);
+ fd = open(devname, O_RDONLY);
+ if (fd == -1)
+ continue;
+ if (vdev_probe(vdev_read, (void*) (uintptr_t) fd, 0))
+ close(fd);
+ }
for (slice = 1; slice <= 128; slice++) {
sprintf(devname, "disk%dp%d:", unit, slice);
fd = open(devname, O_RDONLY);
- if (fd == -1) {
- sprintf(devname, "disk%ds%d:", unit, slice);
- fd = open(devname, O_RDONLY);
- if (fd == -1)
- continue;
- }
+ if (fd == -1)
+ break;
if (vdev_probe(vdev_read, (void*) (uintptr_t) fd, 0))
close(fd);
}
--
jimmy
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007141440.o6EEe5QP091926>
