From owner-freebsd-current@FreeBSD.ORG Sat Jun 19 18:22:11 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4234916A4CE for ; Sat, 19 Jun 2004 18:22:11 +0000 (GMT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id A688443D39 for ; Sat, 19 Jun 2004 18:22:10 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost.freebsd.dk [127.0.0.1]) by critter.freebsd.dk (8.12.11/8.12.11) with ESMTP id i5JILnMh070382; Sat, 19 Jun 2004 20:21:54 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: Bruce Evans From: "Poul-Henning Kamp" In-Reply-To: Your message of "Sat, 19 Jun 2004 20:59:11 +1000." <20040619193901.W770@gamplex.bde.org> Date: Sat, 19 Jun 2004 20:21:49 +0200 Message-ID: <70381.1087669309@critter.freebsd.dk> Sender: phk@critter.freebsd.dk cc: current@freebsd.org Subject: Re: [REVIEW] move tty lock/initial up in the stack X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2004 18:22:11 -0000 In message <20040619193901.W770@gamplex.bde.org>, Bruce Evans writes: >On Sat, 19 Jun 2004, Poul-Henning Kamp wrote: > >> This patch moves the "lock/initial" facility known from sio(4) up >> to the generic tty layer. > >Just moving them is OK. Unfortunately, the patch does less than move >them ... > >... starting here. Control devices in general must be separate so that >they can have different ownership and permissions, and can be opened >without side effects. For sio devices, the non-control devices can't >even be opened if the complementary non-control device is open. I'm not keen on adding four control devices for all ttys in the system, and therefore I decided to collapse the states for both directions and use inband signalling for the changes. I could be persuaded to have a single control-device per tty. >This is missing moving the lock state handling, which comprises about half >of the code that can be moved. This is only the first step of the journey. >The new cases don't belong in this case statement anyway, since the new >ioctls don't involve modification of the active part of the tty struct. I'm not sure I agree, but I don't care much either way. I want to get rid of this duplication of the switch anyway, and use a function call to do the background check and add that functioncall where each ioctl is implemented. -- 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.