Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Sep 1996 12:45:42 +0100 (BST)
From:      Doug Rabson <dfr@render.com>
To:        Michael Hancock <michaelh@cet.co.jp>
Cc:        Bruce Evans <bde@zeta.org.au>, fs@FreeBSD.ORG, lite2@FreeBSD.ORG
Subject:   Re: New d_type field in *devsw
Message-ID:  <Pine.BSF.3.95.960924113016.11343P-100000@minnow.render.com>
In-Reply-To: <Pine.SV4.3.93.960924053628.16671E-100000@parkplace.cet.co.jp>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 24 Sep 1996, Michael Hancock wrote:

> On Tue, 24 Sep 1996, Bruce Evans wrote:
> 
> > >What use is [bc]devsw->d_type in Lite2?  It is not used anywhere and
> > >having it means changing *every* driver in the system since the
> > >initialiser for [bc]devsw is different.  I would quite like to keep
> > >[bc]devsw the same as before the lite2 merge to keep compatability with
> > >existing drivers.  What do others think?
> > 
> > Yes, don't change it.  It probably needs to be done in another way for
> > devfs.
> 
> But what is it?  Is it 'c' or 'b', redundant with the two device switches,
> and needed for abstractions that don't want to discriminate using the
> name?

I looked into this in a bit more detail today.  In lite2, bdevsw->d_type
is used to implement the securelevel for disks and to add some kind of
generic ioctl for tapes.  cdevsw->d_type is used for ttys to change the
behaviour of dead_read.  In FreeBSD, dead_read returns EOF for character
devices and EIO for block devices..  In Lite2, it returns EOF only for
ttys.

There is an existing unused field in bdevsw, d_flags which can be used to
identify disks and tapes for securelevel and ioctl or alternatively the
existing FreeBSD behaviour of calling isdisk() is still possible.  The
current behaviour of dead_read is probably also adequate.

Needless to say, these hacks should be first against the wall after the
devfs revolution :-).

--
Doug Rabson, Microsoft RenderMorphics Ltd.	Mail:  dfr@render.com
						Phone: +44 171 734 3761
						FAX:   +44 171 734 6426




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.960924113016.11343P-100000>