From owner-freebsd-hackers Sat Feb 13 05:51:50 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id FAA08970 for freebsd-hackers-outgoing; Sat, 13 Feb 1999 05:51:50 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from herring.nlsystems.com (nlsys.demon.co.uk [158.152.125.33]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id FAA08965 for ; Sat, 13 Feb 1999 05:51:47 -0800 (PST) (envelope-from dfr@nlsystems.com) Received: from localhost (dfr@localhost) by herring.nlsystems.com (8.9.2/8.8.8) with ESMTP id NAA46119; Sat, 13 Feb 1999 13:50:25 GMT (envelope-from dfr@nlsystems.com) Date: Sat, 13 Feb 1999 13:50:24 +0000 (GMT) From: Doug Rabson To: Matthew Dillon cc: hackers@FreeBSD.ORG Subject: Re: VOP_REMOVE() rules for freeing a_cnp ? In-Reply-To: <199902130857.AAA14274@apollo.backplane.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sat, 13 Feb 1999, Matthew Dillon wrote: > I can't make heads or tails of the VOP_REMOVE() rules for freeing > a_cnp. > > The man page doesn't say anything about having to free cnp. > > ufs_remove() doesn't bother. > > nfs_remove() always frees it. > > And the unlink() system call seems to expect the cnp to be freed > by the VOP_REMOVE() function. > > Typically the rule for freeing a struct componentname in a VOP > routine is 'free it if you return an error, otherwise only free > it if the SAVESTART flag is not set in cn_flags'. > > I would appreciate it if a VFS guru could look at this junk and > tell me whos right. I'm sure that someone changed the semantics for who frees the pathnames and who releases the vnodes during the 3.0 development cycle but I can't quite remember who (Mike someone maybe, not Mike Smith). I think that the intention was to always free the path and release the vnodes in the caller, not in the filesystem (which was supposed to make it easier to write layers). I have a vague recollection that VOP_RENAME was the only one which wasn't changed since it does some wildly complicated things with its vnodes. -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 181 442 9037 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message