From owner-cvs-all@FreeBSD.ORG Wed Apr 11 22:40:57 2007 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BF49C16A402; Wed, 11 Apr 2007 22:40:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id B5E5D13C43E; Wed, 11 Apr 2007 22:40:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l3BMevcY095243; Wed, 11 Apr 2007 22:40:57 GMT (envelope-from des@repoman.freebsd.org) Received: (from des@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l3BMev80095236; Wed, 11 Apr 2007 22:40:57 GMT (envelope-from des) Message-Id: <200704112240.l3BMev80095236@repoman.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 11 Apr 2007 22:40:57 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/fs/pseudofs pseudofs.c pseudofs.h pseudofs_fileno.c pseudofs_internal.h pseudofs_vncache.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2007 22:40:57 -0000 des 2007-04-11 22:40:57 UTC FreeBSD src repository Modified files: sys/fs/pseudofs pseudofs.c pseudofs.h pseudofs_fileno.c pseudofs_internal.h pseudofs_vncache.c Log: Add a flag to struct pfs_vdata to mark the vnode as dead (e.g. process- specific nodes when the process exits) Move the vnode-cache-walking loop which was duplicated in pfs_exit() and pfs_disable() into its own function, pfs_purge(), which looks for vnodes marked as dead and / or belonging to the specified pfs_node and reclaims them. Note that this loop is still extremely inefficient. Add a comment in pfs_vncache_alloc() explaining why we have to purge the vnode from the vnode cache before returning, in case anyone should be tempted to remove the call to cache_purge(). Move the special handling for pfstype_root nodes into pfs_fileno_alloc() and pfs_fileno_free() (the root node's fileno must always be 2). This also fixes a bug where pfs_fileno_free() would reclaim the root node's fileno, triggering a panic in the unr code, as that fileno was never allocated from unr to begin with. When destroying a pfs_node, release its fileno and purge it from the vnode cache. I wish we could put off the call to pfs_purge() until after the entire tree had been destroyed, but then we'd have vnodes referencing freed pfs nodes. This probably doesn't matter while we're still under Giant, but might become an issue later. When destroying a pseudofs instance, destroy the tree before tearing down the fileno allocator. In pfs_mount(), acquire the mountpoint interlock when required. MFC after: 3 weeks Revision Changes Path 1.30 +11 -3 src/sys/fs/pseudofs/pseudofs.c 1.34 +1 -0 src/sys/fs/pseudofs/pseudofs.h 1.13 +12 -1 src/sys/fs/pseudofs/pseudofs_fileno.c 1.5 +1 -0 src/sys/fs/pseudofs/pseudofs_internal.h 1.35 +49 -47 src/sys/fs/pseudofs/pseudofs_vncache.c