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/rwlock.h>
#include <sys/vnode.h>
Include dependency graph for vfs_hash.c:

Go to the source code of this file.

Functions

 __FBSDID ("$FreeBSD$")
 
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_ref (const struct mount *mp, u_int hash, 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)
 
void vfs_hash_changesize (u_long newmaxvnodes)
 

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ LIST_HEAD()

static LIST_HEAD ( vfs_hash_head  ,
vnode   
)
static

Definition at line 43 of file vfs_hash.c.

◆ MALLOC_DEFINE()

static MALLOC_DEFINE ( M_VFS_HASH  ,
"vfs_hash"  ,
"VFS hash table"   
)
static

◆ SYSINIT()

SYSINIT ( vfs_hash  ,
SI_SUB_VFS  ,
SI_ORDER_SECOND  ,
vfs_hashinit  ,
NULL   
)

◆ vfs_hash_bucket()

static struct vfs_hash_head * vfs_hash_bucket ( const struct mount *  mp,
u_int  hash 
)
static

Definition at line 68 of file vfs_hash.c.

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

Here is the caller graph for this function:

◆ vfs_hash_changesize()

void vfs_hash_changesize ( u_long  newmaxvnodes)

Definition at line 209 of file vfs_hash.c.

References free(), hashinit(), and vfs_hash_bucket().

Referenced by sysctl_maxvnodes().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vfs_hash_get()

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 75 of file vfs_hash.c.

References flags, vfs_hash_bucket(), vget_finish(), vget_prep(), and vput().

Here is the call graph for this function:

◆ vfs_hash_index()

u_int vfs_hash_index ( struct vnode *  vp)

Definition at line 61 of file vfs_hash.c.

◆ vfs_hash_insert()

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 155 of file vfs_hash.c.

References flags, vfs_hash_bucket(), vget_finish(), vget_prep(), vgone(), and vput().

Here is the call graph for this function:

◆ vfs_hash_ref()

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

Definition at line 116 of file vfs_hash.c.

References vdrop(), vfs_hash_bucket(), vhold(), and vref().

Here is the call graph for this function:

◆ vfs_hash_rehash()

void vfs_hash_rehash ( struct vnode *  vp,
u_int  hash 
)

Definition at line 197 of file vfs_hash.c.

References vfs_hash_bucket().

Here is the call graph for this function:

◆ vfs_hash_remove()

void vfs_hash_remove ( struct vnode *  vp)

Definition at line 146 of file vfs_hash.c.