Date: Fri, 16 Apr 2010 15:06:40 -0400 From: Sam Robb <samrobb@averesystems.com> To: freebsd-hackers@freebsd.org Subject: Re: Going from struct disk to a fh? Message-ID: <24EE4B09-0317-441A-822A-43F36D7D61E7@averesystems.com> In-Reply-To: <201004141718.05534.jhb@freebsd.org> References: <1DF133F5-6B00-4F06-8837-946702226A54@averesystems.com> <201004141718.05534.jhb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?24EE4B09-0317-441A-822A-43F36D7D61E7>