Date: Mon, 8 Dec 1997 00:00:36 -0800 (PST) From: Julian Elischer <julian@whistle.com> To: S?ren Schmidt <sos@FreeBSD.dk> Cc: hackers@FreeBSD.ORG, mckusick@mckusick.com Subject: Re: [hackers:] Architectural advice needed Message-ID: <Pine.BSF.3.95.971207234113.20612H-100000@current1.whistle.com> In-Reply-To: <199712080724.IAA01786@sos.freebsd.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 8 Dec 1997, S?ren Schmidt wrote: > > Wrong, if a filesystem is mounted, it uses the mnt_stat.f_bsize instead. Exactly.. this is the 100% wrong thing to do. This represents the blocksize of the filesystem on which the /dev directory resides. This is completely independent of the blocksize of the device you are trying to write to. DEVFS has a blocksize of 1 byte, though I SAY 128 for no real reason. So therefore I started getting writes that were made to be multiples of 128. You think this is correct? I am talking about doing the right thing, which is somehow asking the device what it's blocksize is. My system here is working because I removed that code and said bsize = 512; which won't help with cdroms and other devices but at least get's me up and going.. I could have made DEVFS report it's blocksize as 512, but that would just bury the problem. I want to FIX it which is what this email was about.. > This is endeed an ugly hack (I put it there to accomodate devices with > != 512 byt sectors) Which it totally fails to do because everything thinks that they are 512 byte devices, because /dev is on a 512 byte filesystem device. >. Either we let it stay at all times at 512 bytes and > let the device driver chain cope with that, or we use the actual size > of the device throughout the system. #1 is not an option in the long run. I'm talking about #2 why is that wrong? > The whole thing boils down to the question of who deals with the actual > blocksize of the device. Either the entire system knows how to deal > with it (as it sortof is now), or it is handled in the device/slice > layer. I was newer able to favour one clearly above the other... the trouble is that you chose the wrong value to key off. If it were the correct value, the rest of the system would behave a LOT better. (and I know I've done similar things so this is really nothing more than a very MINOR pointy hat in your direction..) Just banging the number to 512 would have been more correct as at least it would have been OBVIOUSLY wrong rather than obscurely wrong. (hat awarded by BDE not me, he found it)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.971207234113.20612H-100000>