From owner-freebsd-hackers Tue Sep 19 21:31:15 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from wally.eecs.harvard.edu (wally.eecs.harvard.edu [140.247.60.30]) by hub.freebsd.org (Postfix) with ESMTP id 6DE2D37B422 for ; Tue, 19 Sep 2000 21:31:09 -0700 (PDT) Received: from localhost (stein@localhost) by wally.eecs.harvard.edu (8.10.0/8.10.0) with ESMTP id e8K4USI04081; Wed, 20 Sep 2000 00:30:28 -0400 (EDT) Date: Wed, 20 Sep 2000 00:30:28 -0400 (EDT) From: Christopher Stein X-Sender: stein@wally To: Marc Tardif Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: writing(2) to raw devices In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG That is only if the write is to a file within a partition mounted as an FFS file system. vn_write() contains the VOP_WRITE switch, which will switch to the write implementation based on the vnode type. VOP_WRITE calls through the function hanging off the vnode in the vnode op vector at the offset specified by vop_write_desc (record defined in sys/compile/GENERIC/vnode_if.c -- generated by a perl script from sys/kern/vnode_if.src during kernel build). Finding out which write implementation is actually hanging off the vnode for the raw device is left as an exercise for the reader. -Chris On Tue, 19 Sep 2000, Marc Tardif wrote: > >From The Design and Implementation of the 4.4BSD Operating System, the > write(2) system call must go through vn_write(), ffs_write(), > ffs_balloc(), cluster(), bio() and finally dev() which performs the actual > disk write. Considering all this block-oriented overhead, how can dd(1) > which calls write(2), perform raw io on devices such as /dev/rwd0? Doesn't > write(2) confine the process to block io by its very nature? > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message