From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 16 19:05:11 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AD501065676 for ; Fri, 16 Apr 2010 19:05:11 +0000 (UTC) (envelope-from samrobb@averesystems.com) Received: from zimbra.averesystems.com (75-149-8-243-Pennsylvania.hfc.comcastbusiness.net [75.149.8.243]) by mx1.freebsd.org (Postfix) with ESMTP id E10778FC19 for ; Fri, 16 Apr 2010 19:05:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by zimbra.averesystems.com (Postfix) with ESMTP id 924D18BC913 for ; Fri, 16 Apr 2010 15:04:12 -0400 (EDT) X-Virus-Scanned: amavisd-new at averesystems.com Received: from zimbra.averesystems.com ([127.0.0.1]) by localhost (zimbra.averesystems.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pUQzVPYVL1Dc for ; Fri, 16 Apr 2010 15:04:11 -0400 (EDT) Received: from [10.0.1.224] (fw.arriad.com [10.0.0.16]) by zimbra.averesystems.com (Postfix) with ESMTPSA id D356D8BC044 for ; Fri, 16 Apr 2010 15:04:11 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1078) From: Sam Robb In-Reply-To: <201004141718.05534.jhb@freebsd.org> Date: Fri, 16 Apr 2010 15:06:40 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: <24EE4B09-0317-441A-822A-43F36D7D61E7@averesystems.com> References: <1DF133F5-6B00-4F06-8837-946702226A54@averesystems.com> <201004141718.05534.jhb@freebsd.org> To: freebsd-hackers@freebsd.org X-Mailer: Apple Mail (2.1078) Subject: Re: Going from struct disk to a fh? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 19:05:11 -0000 On Apr 14, 2010, at 5:18 PM, John Baldwin wrote: > On Wednesday 14 April 2010 9:08:50 am Sam Robb wrote: >> In the kernel, given a struct disk, is there a way to turn that into=20= > something that can be used to read/write from the disk? Or is my best = bet in=20 > this situation to figure out the device path for the disk, and just = use=20 > kern_open() to access it? >=20 > You can use dp->d_geom as the target of a bio via GEOM I think. = However, I=20 > don't have experience with sending bio's to a specific GEOM directly. = File=20 > systems usually use geom_vfs to feed requests from bread(), etc. to a = mounted=20 > disk device using a devfs vnode for the associated disk device. Thanks, John. I've found another way around my problem in user space; = if I revisit the kernel solution, I'll take a look at using bio. -Samrobb=