Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Apr 2010 17:18:05 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-hackers@freebsd.org
Cc:        Sam Robb <samrobb@averesystems.com>
Subject:   Re: Going from struct disk to a fh?
Message-ID:  <201004141718.05534.jhb@freebsd.org>
In-Reply-To: <1DF133F5-6B00-4F06-8837-946702226A54@averesystems.com>
References:  <1DF133F5-6B00-4F06-8837-946702226A54@averesystems.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004141718.05534.jhb>