From owner-freebsd-fs@FreeBSD.ORG Fri Apr 27 14:07:11 2012 Return-Path: Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F354D1065670; Fri, 27 Apr 2012 14:07:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 63F998FC0C; Fri, 27 Apr 2012 14:07:09 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id RAA09079; Fri, 27 Apr 2012 17:07:07 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <4F9AA80A.6040506@FreeBSD.org> Date: Fri, 27 Apr 2012 17:07:06 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120426 Thunderbird/12.0 MIME-Version: 1.0 To: "Andrey V. Elsukov" References: <4F8999D2.1080902@FreeBSD.org> <20120422212102.GA66855@alchemy.franken.de> <4F94F56E.1010501@FreeBSD.org> <4F9A6369.5060305@FreeBSD.org> <4F9A76E5.7000809@FreeBSD.org> In-Reply-To: <4F9A76E5.7000809@FreeBSD.org> X-Enigmail-Version: 1.4 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-fs@FreeBSD.org, freebsd-hackers@FreeBSD.org, John Baldwin , Marius Strobl Subject: Re: [review request] zfsboot/zfsloader: support accessing filesystems within a pool X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2012 14:07:11 -0000 on 27/04/2012 13:37 Andrey V. Elsukov said the following: > What you think about this concept: > We can implement some MI API to query disks count and each disk parameters (mediasize, > sectorsize). This MI code will use some IOCTL that will act with MD "disk"'s devsw->ioctl. > > devicename.c functions can be changed to use MI DISK API together with PART API, > or maybe even moved to the MI code. > > In the result we will have some MI API to get access to the disks and partitions, > that we can use anywhere, e.g. in the ZFS code. Sorry, but I couldn't understand your design. Probably I am missing the bigger picture. I think that for ZFS case it would be sufficient to be able to iterate over detected device names or devspecs. Size and other disk properties do not seem to be needed. Unless I am mistaken, of course. E.g. something akin to what bd_print (dv_print, in the general case) does but oriented towards programmatic use rather than end-user. Maybe all that partition table parsing should be done only once (e.g. in the init method) and the result should be saved. -- Andriy Gapon