FreeBSD kernel kern code
kern_rangelock.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/rangelock.h>
#include <sys/systm.h>
#include <vm/uma.h>
Include dependency graph for kern_rangelock.c:

Go to the source code of this file.

Data Structures

struct  rl_q_entry
 

Functions

 __FBSDID ("$BSDSUniX$")
 
static void rangelock_sys_init (void)
 
 SYSINIT (vfs, SI_SUB_LOCK, SI_ORDER_ANY, rangelock_sys_init, NULL)
 
static struct rl_q_entryrlqentry_alloc (void)
 
void rlqentry_free (struct rl_q_entry *rleq)
 
void rangelock_init (struct rangelock *lock)
 
void rangelock_destroy (struct rangelock *lock)
 
static int rangelock_incompatible (const struct rl_q_entry *e1, const struct rl_q_entry *e2)
 
static void rangelock_calc_block (struct rangelock *lock)
 
static void rangelock_unlock_locked (struct rangelock *lock, struct rl_q_entry *entry, struct mtx *ilk)
 
void rangelock_unlock (struct rangelock *lock, void *cookie, struct mtx *ilk)
 
void * rangelock_unlock_range (struct rangelock *lock, void *cookie, off_t start, off_t end, struct mtx *ilk)
 
static void * rangelock_enqueue (struct rangelock *lock, off_t start, off_t end, int mode, struct mtx *ilk)
 
void * rangelock_rlock (struct rangelock *lock, off_t start, off_t end, struct mtx *ilk)
 
void * rangelock_wlock (struct rangelock *lock, off_t start, off_t end, struct mtx *ilk)
 

Variables

static uma_zone_t rl_entry_zone
 

Function Documentation

__FBSDID ( "$BSDSUniX$"  )
static void rangelock_calc_block ( struct rangelock *  lock)
static

Definition at line 110 of file kern_rangelock.c.

References rangelock_incompatible(), and wakeup().

Referenced by rangelock_enqueue(), rangelock_unlock_locked(), and rangelock_unlock_range().

Here is the call graph for this function:

Here is the caller graph for this function:

void rangelock_destroy ( struct rangelock *  lock)

Definition at line 80 of file kern_rangelock.c.

Referenced by vdropl().

Here is the caller graph for this function:

static void* rangelock_enqueue ( struct rangelock *  lock,
off_t  start,
off_t  end,
int  mode,
struct mtx *  ilk 
)
static

Definition at line 198 of file kern_rangelock.c.

References mode, rangelock_calc_block(), rlqentry_alloc(), and start.

Referenced by rangelock_rlock(), and rangelock_wlock().

Here is the call graph for this function:

Here is the caller graph for this function:

static int rangelock_incompatible ( const struct rl_q_entry e1,
const struct rl_q_entry e2 
)
static

Definition at line 94 of file kern_rangelock.c.

Referenced by rangelock_calc_block().

Here is the caller graph for this function:

void rangelock_init ( struct rangelock *  lock)

Definition at line 72 of file kern_rangelock.c.

Referenced by getnewvnode().

Here is the caller graph for this function:

void* rangelock_rlock ( struct rangelock *  lock,
off_t  start,
off_t  end,
struct mtx *  ilk 
)

Definition at line 235 of file kern_rangelock.c.

References rangelock_enqueue().

Here is the call graph for this function:

static void rangelock_sys_init ( void  )
static

Definition at line 49 of file kern_rangelock.c.

References rl_entry_zone.

void rangelock_unlock ( struct rangelock *  lock,
void *  cookie,
struct mtx *  ilk 
)

Definition at line 157 of file kern_rangelock.c.

References rangelock_unlock_locked().

Here is the call graph for this function:

static void rangelock_unlock_locked ( struct rangelock *  lock,
struct rl_q_entry entry,
struct mtx *  ilk 
)
static

Definition at line 139 of file kern_rangelock.c.

References rangelock_calc_block(), and rlqentry_free().

Referenced by rangelock_unlock(), and rangelock_unlock_range().

Here is the call graph for this function:

Here is the caller graph for this function:

void* rangelock_unlock_range ( struct rangelock *  lock,
void *  cookie,
off_t  start,
off_t  end,
struct mtx *  ilk 
)

Definition at line 170 of file kern_rangelock.c.

References rangelock_calc_block(), and rangelock_unlock_locked().

Here is the call graph for this function:

void* rangelock_wlock ( struct rangelock *  lock,
off_t  start,
off_t  end,
struct mtx *  ilk 
)

Definition at line 242 of file kern_rangelock.c.

References rangelock_enqueue().

Here is the call graph for this function:

static struct rl_q_entry* rlqentry_alloc ( void  )
static

Definition at line 58 of file kern_rangelock.c.

References rl_entry_zone.

Referenced by rangelock_enqueue().

Here is the caller graph for this function:

void rlqentry_free ( struct rl_q_entry rleq)

Definition at line 65 of file kern_rangelock.c.

References rl_entry_zone.

Referenced by rangelock_unlock_locked(), and thread_fini().

Here is the caller graph for this function:

SYSINIT ( vfs  ,
SI_SUB_LOCK  ,
SI_ORDER_ANY  ,
rangelock_sys_init  ,
NULL   
)

Variable Documentation

uma_zone_t rl_entry_zone
static

Definition at line 46 of file kern_rangelock.c.

Referenced by rangelock_sys_init(), rlqentry_alloc(), and rlqentry_free().