FreeBSD kernel kern code
vfs_hash.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/mount.h>
#include <sys/vnode.h>
Include dependency graph for vfs_hash.c:

Go to the source code of this file.

Functions

 __FBSDID ("$BSDSUniX$")
 
static MALLOC_DEFINE (M_VFS_HASH,"vfs_hash","VFS hash table")
 
static LIST_HEAD (vfs_hash_head, vnode)
 
 SYSINIT (vfs_hash, SI_SUB_VFS, SI_ORDER_SECOND, vfs_hashinit, NULL)
 
u_int vfs_hash_index (struct vnode *vp)
 
static struct vfs_hash_head * vfs_hash_bucket (const struct mount *mp, u_int hash)
 
int vfs_hash_get (const struct mount *mp, u_int hash, int flags, struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg)
 
void vfs_hash_remove (struct vnode *vp)
 
int vfs_hash_insert (struct vnode *vp, u_int hash, int flags, struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg)
 
void vfs_hash_rehash (struct vnode *vp, u_int hash)
 

Function Documentation

__FBSDID ( "$BSDSUniX$"  )
static LIST_HEAD ( vfs_hash_head  ,
vnode   
)
static

Definition at line 40 of file vfs_hash.c.

References desiredvnodes, hashinit(), and mtx_init().

Here is the call graph for this function:

static MALLOC_DEFINE ( M_VFS_HASH  ,
"vfs_hash"  ,
"VFS hash table"   
)
static
SYSINIT ( vfs_hash  ,
SI_SUB_VFS  ,
SI_ORDER_SECOND  ,
vfs_hashinit  ,
NULL   
)
static struct vfs_hash_head* vfs_hash_bucket ( const struct mount *  mp,
u_int  hash 
)
static

Definition at line 65 of file vfs_hash.c.

Referenced by vfs_hash_get(), vfs_hash_insert(), and vfs_hash_rehash().

Here is the caller graph for this function:

int vfs_hash_get ( const struct mount *  mp,
u_int  hash,
int  flags,
struct thread *  td,
struct vnode **  vpp,
vfs_hash_cmp_t *  fn,
void *  arg 
)

Definition at line 72 of file vfs_hash.c.

References vfs_hash_bucket(), and vget().

Here is the call graph for this function:

u_int vfs_hash_index ( struct vnode *  vp)

Definition at line 58 of file vfs_hash.c.

int vfs_hash_insert ( struct vnode *  vp,
u_int  hash,
int  flags,
struct thread *  td,
struct vnode **  vpp,
vfs_hash_cmp_t *  fn,
void *  arg 
)

Definition at line 114 of file vfs_hash.c.

References vfs_hash_bucket(), vget(), and vput().

Here is the call graph for this function:

void vfs_hash_rehash ( struct vnode *  vp,
u_int  hash 
)

Definition at line 154 of file vfs_hash.c.

References vfs_hash_bucket().

Here is the call graph for this function:

void vfs_hash_remove ( struct vnode *  vp)

Definition at line 105 of file vfs_hash.c.