From owner-svn-src-all@FreeBSD.ORG Wed Jan 12 23:34:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF1451065675; Wed, 12 Jan 2011 23:34:09 +0000 (UTC) (envelope-from zack@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE4FA8FC1C; Wed, 12 Jan 2011 23:34:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0CNY9dT025734; Wed, 12 Jan 2011 23:34:09 GMT (envelope-from zack@svn.freebsd.org) Received: (from zack@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0CNY9BD025731; Wed, 12 Jan 2011 23:34:09 GMT (envelope-from zack@svn.freebsd.org) Message-Id: <201101122334.p0CNY9BD025731@svn.freebsd.org> From: Zack Kirsch Date: Wed, 12 Jan 2011 23:34:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217335 - head/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jan 2011 23:34:10 -0000 Author: zack Date: Wed Jan 12 23:34:09 2011 New Revision: 217335 URL: http://svn.freebsd.org/changeset/base/217335 Log: Clean up the experimental NFS server replay cache when the module is unloaded. Reviewed by: rmacklem Approved by: zml (mentor) Modified: head/sys/fs/nfsserver/nfs_nfsdcache.c head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfsserver/nfs_nfsdcache.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdcache.c Wed Jan 12 23:31:28 2011 (r217334) +++ head/sys/fs/nfsserver/nfs_nfsdcache.c Wed Jan 12 23:34:09 2011 (r217335) @@ -727,9 +727,8 @@ nfsrc_freecache(struct nfsrvcache *rp) newnfsstats.srvcache_size--; } -#ifdef notdef /* - * Clean out the cache. Called when the last nfsd terminates. + * Clean out the cache. Called when nfsserver module is unloaded. */ APPLESTATIC void nfsrvd_cleancache(void) @@ -752,7 +751,6 @@ nfsrvd_cleancache(void) nfsrc_tcpsavedreplies = 0; NFSUNLOCKCACHE(); } -#endif /* notdef */ /* * The basic rule is to get rid of entries that are expired. Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Wed Jan 12 23:31:28 2011 (r217334) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Wed Jan 12 23:34:09 2011 (r217335) @@ -3078,6 +3078,10 @@ nfsd_modevent(module_t mod, int type, vo #endif nfsd_call_servertimer = NULL; nfsd_call_nfsd = NULL; + + /* Clean the NFS server reply cache */ + nfsrvd_cleancache(); + /* and get rid of the locks */ mtx_destroy(&nfs_cache_mutex); mtx_destroy(&nfs_v4root_mutex);