From owner-cvs-all Thu May 17 5:58:36 2001 Delivered-To: cvs-all@freebsd.org Received: from Awfulhak.org (awfulhak.demon.co.uk [194.222.196.252]) by hub.freebsd.org (Postfix) with ESMTP id E6F3637B422; Thu, 17 May 2001 05:58:27 -0700 (PDT) (envelope-from brian@Awfulhak.org) Received: from hak.lan.Awfulhak.org (root@hak.lan.Awfulhak.org [172.16.0.12]) by Awfulhak.org (8.11.3/8.11.3) with ESMTP id f4HCwLP01017; Thu, 17 May 2001 13:58:21 +0100 (BST) (envelope-from brian@lan.Awfulhak.org) Received: from hak.lan.Awfulhak.org (brian@localhost [127.0.0.1]) by hak.lan.Awfulhak.org (8.11.3/8.11.3) with ESMTP id f4HCwKb63116; Thu, 17 May 2001 13:58:20 +0100 (BST) (envelope-from brian@hak.lan.Awfulhak.org) Message-Id: <200105171258.f4HCwKb63116@hak.lan.Awfulhak.org> X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: Poul-Henning Kamp Cc: Brian Somers , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org, brian@Awfulhak.org Subject: Re: cvs commit: src/sys/fs/devfs devfs_vnops.c In-Reply-To: Message from Poul-Henning Kamp of "Tue, 15 May 2001 10:25:30 +0200." <30165.989915130@critter> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 17 May 2001 13:58:20 +0100 From: Brian Somers Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > >> Revision Changes Path > >> 1.23 +7 -15 src/sys/fs/devfs/devfs_vnops.c > > > >Does this mean that I can catch ``open("/dev/tun")'' and clone (say) > >/dev/tun100, returning that ? > > yes :-) I think the only thing that's missing is that you can't have the clone handler called for an existing device node. I'd like to be able to make_dev() /dev/tun during attach and allow the sysadmin (or whatever) to change it's permissions. Then, when an attempt to open it is made, have my clone handler called. My clone handler make_dev()s /dev/tunN and returns that. When /dev/tunN's final close is done, I destroy_dev() it. Unfortunately, I don't think this can be done very easily. We'd need to allocate a new vnode only at open time - probably in vn_open. It'd probably be convenient if devfs was able to set some new vnode flag in vnodes returned from it's lookup based on some flag passed into make_dev() (oops, there are no flags there). When vn_open() sees the flag, it calls some registered handler that goes off and returns either the original vnode or (if successfully cloned) a new vnode. Does any of that make sense ? > -- > 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. -- Brian Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message