From owner-freebsd-fs@FreeBSD.ORG Mon Nov 17 11:31:05 2003 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 712D416A4CE; Mon, 17 Nov 2003 11:31:05 -0800 (PST) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9021F43FBD; Mon, 17 Nov 2003 11:31:04 -0800 (PST) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 8771B2ED46D; Mon, 17 Nov 2003 11:31:04 -0800 (PST) Date: Mon, 17 Nov 2003 11:31:04 -0800 From: Alfred Perlstein To: Robert Watson Message-ID: <20031117193104.GH35957@elvis.mu.org> References: <20031117052258.GB35957@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i cc: bp@freebsd.org cc: marcel@freebsd.org cc: fs@freebsd.org Subject: Re: open cookies X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2003 19:31:05 -0000 * Robert Watson [031117 10:13] wrote: > > On Sun, 16 Nov 2003, Alfred Perlstein wrote: > > > I'm starting to do the gruntwork of getting us per-open cookies for file > > operations. If someone can explain what needs to be done that would > > speed things up. :) > > I implemented about 90% of this previously and did not commit it. In > general, the notion of "session" corresponds well to the notion of "file > descriptor"; I found that this meant only VOPs that could be performed on > a vnode pulled out of a file descriptor were relevant. When a VOP is > dual-purpose: i.e., can be called using both "by name" and "with a > session", or even just "without a session", I used NULL for the cookie > argument to the VOP. Since we nominally support file system stacking, I > found that, much as you concluded, we needed a cookie rather than passing > struct file into each VOP, which works with the top layer but not for > lower layers. As we stuff a lower layer vnode reference into the > per-vnode state, we now have to stuff per-open state material into each > layer's per-open state. > > My general conclusion was that this over-complicated our VFS > substantially, and that the struct file state in Linux was generally used > only for multiply instantiated devices. With devfs cloning, all the cases > I was interested in (things like /dev vmware nodes) are addressed. Since > none of our non-specfs nodes required any notion of state, I found I was > touching a lot of code to minimal benefit. What's your motivation for > adding this support, and can it be added in a way that doesn't introduce > new arguments to most VOPs, and introduce a host of potential bugs? I > don't doubt it can be done right, but it's a fairly complex solution that > has to be motivated by complex requirements... I just wanted to support the way that Linux does stuff. Are you saying that it's taken care of? -- - Alfred Perlstein - Research Engineering Development Inc. - email: bright@mu.org cell: 408-480-4684