From owner-freebsd-emulation Thu Oct 3 5:57:13 2002 Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 29B1637B401; Thu, 3 Oct 2002 05:57:12 -0700 (PDT) Received: from critter.freebsd.dk (esplanaden.cybercity.dk [212.242.40.114]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2E21843E4A; Thu, 3 Oct 2002 05:57:11 -0700 (PDT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.6/8.12.6) with ESMTP id g93CuZZ5003210; Thu, 3 Oct 2002 14:56:36 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: Mark Santcroos Cc: Bruce Evans , freebsd-hackers@FreeBSD.ORG, emulation@FreeBSD.ORG Subject: Re: vmware reads disk on non-sector boundary In-Reply-To: Your message of "Thu, 03 Oct 2002 13:56:49 +0200." <20021003115649.GC584@laptop.6bone.nl> Date: Thu, 03 Oct 2002 14:56:35 +0200 Message-ID: <3209.1033649795@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org In message <20021003115649.GC584@laptop.6bone.nl>, Mark Santcroos writes: >On Thu, Oct 03, 2002 at 09:50:45PM +1000, Bruce Evans wrote: >> Unbreaking block devices would be a better solution. Without buffering, >> reads of raw disks using an unbuffered linux_read() might be >> times slower than they should be. > >You are right. The quick and dirty hack I had in mind was less quick >and more dirty than I expected ;-) > >What was the reason for the removal of block devices anyway? >It would be nice if you would tell me some background about that.. :) It's well documented in the mail-archives actually. The short story: 1. We don't in general assign a special vnode type to device modes, instead we assign multiple device nodes, SCSI tapes is an example of this. 2. The vnode layer already have enough trouble aliasing /dev/fd0, /mnt/dev/fd0, /usr/jail/dev/fd0, /cdrom/dev/fd0 (you get the idea), we do not need to make it even harder by also aliasing /dev/fd0 and /dev/rfd0. 3. Write ordering on buffered devices were unspecified. In other words, you cannot use it for anything which even remotely smells of transactions, because you have no way to know when your writes have hit the disk and in which order they did so. 4. No write errors were reported back to userland. (Given 3 and 4, it follows that use of block devices for any sort of data you happen to like is a very bad idea.) 5. Block devices was in the way of getting DEVFS working in an architecturally sane manner. So they were removed, and good riddance. If a buffered access-mode on block devices is desired, it should be implemented either as an ioctl controllable feature, or as a GEOM module. The latter is probably by far the easiest way. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message