vfs_hash.c (167497) | vfs_hash.c (177253) |
---|---|
1/*- 2 * Copyright (c) 2005 Poul-Henning Kamp 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 --- 12 unchanged lines hidden (view full) --- 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 */ 27 28#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2005 Poul-Henning Kamp 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 --- 12 unchanged lines hidden (view full) --- 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 */ 27 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: head/sys/kern/vfs_hash.c 167497 2007-03-13 01:50:27Z tegge $"); | 29__FBSDID("$FreeBSD: head/sys/kern/vfs_hash.c 177253 2008-03-16 10:58:09Z rwatson $"); |
30 31#include <sys/param.h> 32#include <sys/systm.h> 33#include <sys/kernel.h> 34#include <sys/malloc.h> 35#include <sys/mount.h> 36#include <sys/vnode.h> 37 --- 9 unchanged lines hidden (view full) --- 47{ 48 49 vfs_hash_tbl = hashinit(desiredvnodes, M_VFS_HASH, &vfs_hash_mask); 50 mtx_init(&vfs_hash_mtx, "vfs hash", NULL, MTX_DEF); 51 LIST_INIT(&vfs_hash_side); 52} 53 54/* Must be SI_ORDER_SECOND so desiredvnodes is available */ | 30 31#include <sys/param.h> 32#include <sys/systm.h> 33#include <sys/kernel.h> 34#include <sys/malloc.h> 35#include <sys/mount.h> 36#include <sys/vnode.h> 37 --- 9 unchanged lines hidden (view full) --- 47{ 48 49 vfs_hash_tbl = hashinit(desiredvnodes, M_VFS_HASH, &vfs_hash_mask); 50 mtx_init(&vfs_hash_mtx, "vfs hash", NULL, MTX_DEF); 51 LIST_INIT(&vfs_hash_side); 52} 53 54/* Must be SI_ORDER_SECOND so desiredvnodes is available */ |
55SYSINIT(vfs_hash, SI_SUB_VFS, SI_ORDER_SECOND, vfs_hashinit, NULL) | 55SYSINIT(vfs_hash, SI_SUB_VFS, SI_ORDER_SECOND, vfs_hashinit, NULL); |
56 57static struct vfs_hash_head * 58vfs_hash_index(const struct mount *mp, u_int hash) 59{ 60 61 return(&vfs_hash_tbl[(hash + mp->mnt_hashseed) & vfs_hash_mask]); 62} 63 --- 92 unchanged lines hidden --- | 56 57static struct vfs_hash_head * 58vfs_hash_index(const struct mount *mp, u_int hash) 59{ 60 61 return(&vfs_hash_tbl[(hash + mp->mnt_hashseed) & vfs_hash_mask]); 62} 63 --- 92 unchanged lines hidden --- |