From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 21:22:23 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 2E3431065674 for ; Wed, 14 Apr 2010 21:22:23 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id F3BAF8FC15 for ; Wed, 14 Apr 2010 21:22:22 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id A71F546B99; Wed, 14 Apr 2010 17:22:22 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id E89D78A025; Wed, 14 Apr 2010 17:22:21 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Wed, 14 Apr 2010 17:18:05 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <1DF133F5-6B00-4F06-8837-946702226A54@averesystems.com> In-Reply-To: <1DF133F5-6B00-4F06-8837-946702226A54@averesystems.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201004141718.05534.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 14 Apr 2010 17:22:21 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.8 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Sam Robb 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: Wed, 14 Apr 2010 21:22:23 -0000 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 something that can be used to read/write from the disk? Or is my best bet in this situation to figure out the device path for the disk, and just use kern_open() to access it? You can use dp->d_geom as the target of a bio via GEOM I think. However, I don't have experience with sending bio's to a specific GEOM directly. File systems usually use geom_vfs to feed requests from bread(), etc. to a mounted disk device using a devfs vnode for the associated disk device. -- John Baldwin