pseudofs_vncache.c (168637) | pseudofs_vncache.c (168720) |
---|---|
1/*- 2 * Copyright (c) 2001 Dag-Erling Co�dan Sm�rgrav 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001 Dag-Erling Co�dan Sm�rgrav 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/fs/pseudofs/pseudofs_vncache.c 168637 2007-04-11 22:40:57Z des $"); | 30__FBSDID("$FreeBSD: head/sys/fs/pseudofs/pseudofs_vncache.c 168720 2007-04-14 14:08:30Z des $"); |
31 32#include "opt_pseudofs.h" 33 34#include <sys/param.h> 35#include <sys/kernel.h> 36#include <sys/systm.h> 37#include <sys/eventhandler.h> 38#include <sys/lock.h> --- 39 unchanged lines hidden (view full) --- 78extern struct vop_vector pfs_vnodeops; /* XXX -> .h file */ 79 80/* 81 * Initialize vnode cache 82 */ 83void 84pfs_vncache_load(void) 85{ | 31 32#include "opt_pseudofs.h" 33 34#include <sys/param.h> 35#include <sys/kernel.h> 36#include <sys/systm.h> 37#include <sys/eventhandler.h> 38#include <sys/lock.h> --- 39 unchanged lines hidden (view full) --- 78extern struct vop_vector pfs_vnodeops; /* XXX -> .h file */ 79 80/* 81 * Initialize vnode cache 82 */ 83void 84pfs_vncache_load(void) 85{ |
86 mtx_init(&pfs_vncache_mutex, "pseudofs_vncache", NULL, MTX_DEF); | 86 87 mtx_assert(&Giant, MA_OWNED); 88 mtx_init(&pfs_vncache_mutex, "pfs_vncache", NULL, MTX_DEF); |
87 pfs_exit_tag = EVENTHANDLER_REGISTER(process_exit, pfs_exit, NULL, 88 EVENTHANDLER_PRI_ANY); 89} 90 91/* 92 * Tear down vnode cache 93 */ 94void 95pfs_vncache_unload(void) 96{ | 89 pfs_exit_tag = EVENTHANDLER_REGISTER(process_exit, pfs_exit, NULL, 90 EVENTHANDLER_PRI_ANY); 91} 92 93/* 94 * Tear down vnode cache 95 */ 96void 97pfs_vncache_unload(void) 98{ |
99 100 mtx_assert(&Giant, MA_OWNED); |
|
97 EVENTHANDLER_DEREGISTER(process_exit, pfs_exit_tag); | 101 EVENTHANDLER_DEREGISTER(process_exit, pfs_exit_tag); |
98 if (pfs_vncache_entries != 0) 99 printf("pfs_vncache_unload(): %d entries remaining\n", 100 pfs_vncache_entries); | 102 KASSERT(pfs_vncache_entries == 0, 103 ("%d vncache entries remaining", pfs_vncache_entries)); |
101 mtx_destroy(&pfs_vncache_mutex); 102} 103 104/* 105 * Allocate a vnode 106 */ 107int 108pfs_vncache_alloc(struct mount *mp, struct vnode **vpp, --- 212 unchanged lines hidden --- | 104 mtx_destroy(&pfs_vncache_mutex); 105} 106 107/* 108 * Allocate a vnode 109 */ 110int 111pfs_vncache_alloc(struct mount *mp, struct vnode **vpp, --- 212 unchanged lines hidden --- |