From owner-freebsd-hackers Mon Oct 20 22:17:24 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id WAA19608 for hackers-outgoing; Mon, 20 Oct 1997 22:17:24 -0700 (PDT) (envelope-from owner-freebsd-hackers) Received: from pluto.plutotech.com (ken@mail.plutotech.com [206.168.67.137]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id WAA19602 for ; Mon, 20 Oct 1997 22:17:21 -0700 (PDT) (envelope-from ken@plutotech.com) Received: (from ken@localhost) by pluto.plutotech.com (8.8.5/8.8.5) id XAA18704; Mon, 20 Oct 1997 23:17:20 -0600 (MDT) From: Kenneth Merry Message-Id: <199710210517.XAA18704@pluto.plutotech.com> Subject: Re: user vm addr to kernel vm addr In-Reply-To: <199710210201.UAA10419@pluto.plutotech.com> from Mike Durian at "Oct 20, 97 08:01:11 pm" To: durian@plutotech.com (Mike Durian) Date: Mon, 20 Oct 1997 23:17:20 -0600 (MDT) Cc: hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL28s (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Mike Durian wrote... > In my virtual file system I'd like to speed up reads and writes > by copying directly from the uio structure to a vm address of > a buffer in the user process running on behalf of the filesystem. > I'm currently shoving all the data through a socket that the > user process reads from and copies into a buffer. I'd like to > go direct and skip the socket writing part. Does that make sense? > Anyway, I want to copy from a uio to a different process's vm space. > I can get the vm address of the destination buffer over a socket and > think I can use vm_fault_wire to make sure it stays accessable, but > I don't know how to convert that user space vm address into a > kernel space vm address that I can then use with copyout. > Is there an easy (or any) way to do this? I'm not positive this is what you're looking for, but... one way to do it is to map the user address into the kernel address space using vmapbuf(). If you want a specific code example, just let me know. (or look in the CAM SCSI passthrough driver for the passmapmem() and passunmapmem() functions) Ken -- Kenneth Merry ken@plutotech.com