From owner-freebsd-fs@FreeBSD.ORG Tue Jul 27 12:10:03 2010 Return-Path: Delivered-To: freebsd-fs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 905861065672 for ; Tue, 27 Jul 2010 12:10:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 673D08FC1E for ; Tue, 27 Jul 2010 12:10:03 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o6RCA3he090116 for ; Tue, 27 Jul 2010 12:10:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o6RCA3Xp090114; Tue, 27 Jul 2010 12:10:03 GMT (envelope-from gnats) Date: Tue, 27 Jul 2010 12:10:03 GMT Message-Id: <201007271210.o6RCA3Xp090114@freefall.freebsd.org> To: freebsd-fs@FreeBSD.org From: Jimmy Olgeni Cc: Subject: Re: bin/148296: [zfs] [loader] [patch] Very slow probe in /usr/src/sys/boot/zfs/zfs.c X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Jimmy Olgeni List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jul 2010 12:10:03 -0000 The following reply was made to PR bin/148296; it has been noted by GNATS. From: Jimmy Olgeni To: Andriy Gapon Cc: "Andrey V. Elsukov" , bug-followup@FreeBSD.org, Norikatsu Shigemura Subject: Re: bin/148296: [zfs] [loader] [patch] Very slow probe in /usr/src/sys/boot/zfs/zfs.c Date: Tue, 27 Jul 2010 14:06:42 +0200 (CEST) On Mon, 26 Jul 2010, Andriy Gapon wrote: > I still think that we need a method for querying partition scheme and available > partitions for a disk. Perhaps for "biosdisk" only at this point. I poked around a bit... If we #include "../i386/libi386/libi386.h" (which seems a bit ugly here) then we can examine the partition layout using _data._gpt.gpt_nparts and _data._gpt.gpt_partitions from struct open_disk: struct i386_devdesc *desc = ((struct i386_devdesc *)(files[fd].f_devdata)); struct open_disk *od = desc->d_kind.biosdisk.data; /* get actual partition count and types */ However, struct open_disk and gpt_part are local to biosdisk.c, so they should probably be moved to a header. Maybe struct open_disk could be moved to stand.h where struct open_file already resides? In that case we would only need to pull i386_devdesc from libi386.h here. -- jimmy