From owner-freebsd-hackers Wed May 17 15:32:38 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from arjun.niksun.com (gwnew.niksun.com [206.20.52.130]) by hub.freebsd.org (Postfix) with ESMTP id 84E5037BC81 for ; Wed, 17 May 2000 15:32:29 -0700 (PDT) (envelope-from joy@niksun.com) Received: from falcon.niksun.com (falcon.niksun.com [10.0.0.167]) by arjun.niksun.com (8.9.3/8.9.3) with ESMTP id SAA03622; Wed, 17 May 2000 18:32:25 -0400 (EDT) (envelope-from joy@falcon.niksun.com) Message-ID: <39231E06.31DFB153@falcon.niksun.com> Date: Wed, 17 May 2000 18:32:38 -0400 From: Joy Ganguly X-Mailer: Mozilla 4.51 [en] (X11; I; FreeBSD 3.2-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: Alfred Perlstein , freebsd-hackers Subject: Re: Question about file write???? References: <20000517160746.12768.qmail@www0a.netaddress.usa.net> <20000517102516.B14968@fw.wintelcom.net> <3922DB0F.9D9095C9@falcon.niksun.com> <20000517135644.D14968@fw.wintelcom.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Alfred Perlstein wrote: > bcopy should be using the hand optimized code, I think you may have > to explain more of what you're doing if anyone is going to be able > to help. well this is what i am doing: i have a device buffer in contiguous physical memory. i want to write that buffer into a file disk. for that ive written a simple ioctl which works similar to the syscall write. except that it transfers from kernel space instead of user space. my user program calls this ioctl with the write file desc....the ioctl calls fp->f_ops->fo_write after setting up the uio to do the transfer. earlier the user code looked like:- fd=open("/dev/mydev",O_RDONLY); buf=malloc(BUFSIZE); read(fd,buf,BUFSIZE); w_fd=open("foo",O_WRONLY|O_CREAT); write(w_fd,buf,BUFSIZE); now the user program looks like: fd=open("/dev/mydev",O_RDONLY); ioctl(fd, MYDEVREAD, &size); w_fd=open("foo",O_WRONLY|O_CREAT); ioctl(w_fd,MYDEVWRITE,size); as a result of this the copy involved in the first read is eliminated. but it takes longer to do the 2nd ioctl than to do the write. if this does not explain what i am doing please let me know. thanx in advance > > -- > -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] > "I have the heart of a child; I keep it in a jar on my desk." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message