From owner-freebsd-hackers Sat Dec 8 17:43:29 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by hub.freebsd.org (Postfix) with ESMTP id A159637B417 for ; Sat, 8 Dec 2001 17:43:21 -0800 (PST) Received: from fledge.watson.org (robert@fledge.pr.watson.org [192.0.2.3]) by fledge.watson.org (8.11.6/8.11.5) with SMTP id fB91h1i77059; Sat, 8 Dec 2001 20:43:01 -0500 (EST) (envelope-from robert@fledge.watson.org) Date: Sat, 8 Dec 2001 20:43:01 -0500 (EST) From: Robert Watson X-Sender: robert@fledge.watson.org To: Alfred Perlstein Cc: Poul-Henning Kamp , Dave Rufino , Terry Lambert , freebsd-hackers@FreeBSD.ORG Subject: Re: statefulness in character device drivers In-Reply-To: <20011208054108.C92148@elvis.mu.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, 8 Dec 2001, Alfred Perlstein wrote: > Yes, but afaik without a way to differenciate between two opens. Being > able to notice whether a file is being operated on via which open is the > important part. > > This would probably involve changing VOP_OPENs to pass a void ** that > would be stored in the struct file that would be passed to subsequent > ioctl/read/write/close operations. I had some patches to do this, but lost them ages ago. If I get really bored next week, I'll redo them and stick them in a perforce branch. That said, it requires a bit more work, but is easier if you define the void** as optional: if it's non-NULL, then you return state, and let it get passed back in. Otherwise, you assume it's traditional stateless access. It requires some tweaking of the vnode pager, among other things, but is actually a relatively straight-forward patch. Maybe I'll give it a spin again and post patches to -arch or something. Robert N M Watson FreeBSD Core Team, TrustedBSD Project robert@fledge.watson.org NAI Labs, Safeport Network Services To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message