From owner-freebsd-arch Mon Jan 29 10:37:23 2001 Delivered-To: freebsd-arch@freebsd.org Received: from Awfulhak.org (awfulhak.demon.co.uk [194.222.196.252]) by hub.freebsd.org (Postfix) with ESMTP id 5057A37B6C8 for ; Mon, 29 Jan 2001 10:37:05 -0800 (PST) Received: from hak.lan.Awfulhak.org (root@hak.lan.Awfulhak.org [172.16.0.12]) by Awfulhak.org (8.11.1/8.11.1) with ESMTP id f0TIbDE09662; Mon, 29 Jan 2001 18:37:16 GMT (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.1/8.11.1) with ESMTP id f0TIcO203434; Mon, 29 Jan 2001 18:38:24 GMT (envelope-from brian@hak.lan.Awfulhak.org) Message-Id: <200101291838.f0TIcO203434@hak.lan.Awfulhak.org> X-Mailer: exmh version 2.2 06/23/2000 with nmh-1.0.4 To: Peter Wemm Cc: Brian Somers , freebsd-arch@FreeBSD.ORG, brian@Awfulhak.org Subject: Re: Cloned open support In-Reply-To: Message from Peter Wemm of "Mon, 29 Jan 2001 06:02:10 PST." <200101291402.f0TE2A451479@mobile.wemm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 29 Jan 2001 18:38:24 +0000 From: Brian Somers Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Brian Somers wrote: > > Hi, > > > > I'm considering having a crack at adding support for cloned opens. > > Before I start, I guess I've got two questions: > > > > 1. Is anybody else doing this. > > > > 2. Given that I'll need to change the d_open prototype (and > > thus cdevsw), I'm going to affect every device driver in the > > tree - although only changing the first arg to a (dev_t) > > pointer, making things pretty easy to change and not too > > unexpected for anyone that's written sysv drivers. > > Not necessary. dev_t *is* a pointer. Add a flag to the device flags to Ach, I was thinking userland-dev_t aka udev_t :-/ Yes, the prototypes don't need to change :-D > indicate that it allows clone opens, and maybe teach specfs a little about > it (ie: that the unit will be reassigned on a clone open) and you're done. I don't think it's that easy. I believe the vnode that's attached to the specinfo needs to be discarded (and any VN_RELE()s done) when the open routine changes dev->si_udev, and probably dev->si_udev needs to be put back. The specinfo code then needs to create a new vnode and return that from VOP_OPEN() - changing the VOP_OPEN() prototype to be passed a vnode **.... I tried before to get things to work by adjusting the vnode that's passed into VOP_OPEN(), but failed miserably - probably because I don't fully understand the relationship between vnodes and the namei stuff.... I *guess* it's cleaner to create the new vnode so that the namei caching side of things can do it's job on the clone device. > Cheers, > -Peter > -- > Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au > "All of this is for nothing if we don't go to the stars" - JMS/B5 -- Brian Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message