From owner-freebsd-hackers Sun Jan 18 20:57:06 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id UAA23540 for hackers-outgoing; Sun, 18 Jan 1998 20:57:06 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id UAA23520; Sun, 18 Jan 1998 20:56:22 -0800 (PST) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id PAA27810; Mon, 19 Jan 1998 15:46:15 +1100 Date: Mon, 19 Jan 1998 15:46:15 +1100 From: Bruce Evans Message-Id: <199801190446.PAA27810@godzilla.zeta.org.au> To: bde@zeta.org.au, pst@juniper.net Subject: Re: isdisk() kludge in kernel Cc: bde@FreeBSD.ORG, dg@FreeBSD.ORG, hackers@FreeBSD.ORG Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk >> >I was looking at isdisk and wanted to hurl chunks. >> > >> >This is used by spec_open to determine if we should be allowed to open a >> >disk device when securelevel >= 1. >> >> It isn't even used in -current. > >I think it is, the flag gets set elsewhere. No it isn't. Individual device drivers know whether they are for disks and set the flag accordingly. This should be fairly easy to merge into 2.2. The d_flags field is in both 2.2 and -current, although it seems to be unused in 2.2 and is bogusly refered to as d_type in a comment in conf.h in -current (*), so you just need to set it in all the disk drivers and check it in isdisk() or inline. (*) We got the comment but not the code from Lite2. d_flags is only in the bdevsw; the flags for cdevs are assumed to be the same as for bdevs. We're missing Lite2's fix for dead_read() on ttys because there is nowhere to set D_TTY for ttys. Bruce