FreeBSD kernel kern code
|
#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>
Go to the source code of this file.
Data Structures | |
struct | rl_q_entry |
Functions | |
__FBSDID ("$FreeBSD$") | |
static void | rangelock_sys_init (void) |
SYSINIT (vfs, SI_SUB_LOCK, SI_ORDER_ANY, rangelock_sys_init, NULL) | |
static struct rl_q_entry * | rlqentry_alloc (void) |
void | rlqentry_free (struct rl_q_entry *rleq) |
void | rangelock_init (struct rangelock *lock) |
void | rangelock_destroy (struct rangelock *lock) |
static int | ranges_overlap (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, bool do_calc_block) |
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, bool trylock) |
void * | rangelock_rlock (struct rangelock *lock, off_t start, off_t end, struct mtx *ilk) |
void * | rangelock_tryrlock (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) |
void * | rangelock_trywlock (struct rangelock *lock, off_t start, off_t end, struct mtx *ilk) |
Variables | |
static uma_zone_t | rl_entry_zone |
__FBSDID | ( | "$FreeBSD$" | ) |
|
static |
Definition at line 106 of file kern_rangelock.c.
References ranges_overlap(), and wakeup().
Referenced by rangelock_enqueue(), rangelock_unlock_locked(), and rangelock_unlock_range().
void rangelock_destroy | ( | struct rangelock * | lock | ) |
Definition at line 82 of file kern_rangelock.c.
Referenced by shm_drop(), and vnode_fini().
|
static |
Definition at line 220 of file kern_rangelock.c.
References mode, rangelock_calc_block(), rangelock_unlock_locked(), rlqentry_alloc(), and start.
Referenced by rangelock_rlock(), rangelock_tryrlock(), rangelock_trywlock(), and rangelock_wlock().
void rangelock_init | ( | struct rangelock * | lock | ) |
Definition at line 74 of file kern_rangelock.c.
Referenced by shm_alloc(), and vnode_init().
void * rangelock_rlock | ( | struct rangelock * | lock, |
off_t | start, | ||
off_t | end, | ||
struct mtx * | ilk | ||
) |
Definition at line 274 of file kern_rangelock.c.
References rangelock_enqueue(), and start.
Referenced by shm_ioctl(), shm_mmap(), and shm_read().
|
static |
Definition at line 51 of file kern_rangelock.c.
References rl_entry_zone.
void * rangelock_tryrlock | ( | struct rangelock * | lock, |
off_t | start, | ||
off_t | end, | ||
struct mtx * | ilk | ||
) |
Definition at line 281 of file kern_rangelock.c.
References rangelock_enqueue(), and start.
void * rangelock_trywlock | ( | struct rangelock * | lock, |
off_t | start, | ||
off_t | end, | ||
struct mtx * | ilk | ||
) |
Definition at line 296 of file kern_rangelock.c.
References rangelock_enqueue(), and start.
void rangelock_unlock | ( | struct rangelock * | lock, |
void * | cookie, | ||
struct mtx * | ilk | ||
) |
Definition at line 179 of file kern_rangelock.c.
References rangelock_unlock_locked().
Referenced by kern_shm_open2(), shm_add_seals(), shm_dotruncate(), shm_fallocate(), shm_fspacectl(), shm_ioctl(), shm_mmap(), shm_read(), and shm_write().
|
static |
Definition at line 143 of file kern_rangelock.c.
References rangelock_calc_block(), and rlqentry_free().
Referenced by rangelock_enqueue(), rangelock_unlock(), and rangelock_unlock_range().
void * rangelock_unlock_range | ( | struct rangelock * | lock, |
void * | cookie, | ||
off_t | start, | ||
off_t | end, | ||
struct mtx * | ilk | ||
) |
Definition at line 192 of file kern_rangelock.c.
References rangelock_calc_block(), rangelock_unlock_locked(), and start.
void * rangelock_wlock | ( | struct rangelock * | lock, |
off_t | start, | ||
off_t | end, | ||
struct mtx * | ilk | ||
) |
Definition at line 289 of file kern_rangelock.c.
References rangelock_enqueue(), and start.
Referenced by kern_shm_open2(), shm_add_seals(), shm_dotruncate(), shm_fallocate(), shm_fspacectl(), shm_ioctl(), and shm_write().
|
static |
Definition at line 93 of file kern_rangelock.c.
Referenced by rangelock_calc_block().
|
static |
Definition at line 60 of file kern_rangelock.c.
References rl_entry_zone.
Referenced by rangelock_enqueue().
void rlqentry_free | ( | struct rl_q_entry * | rleq | ) |
Definition at line 67 of file kern_rangelock.c.
References rl_entry_zone.
Referenced by rangelock_unlock_locked(), and thread_fini().
SYSINIT | ( | vfs | , |
SI_SUB_LOCK | , | ||
SI_ORDER_ANY | , | ||
rangelock_sys_init | , | ||
NULL | |||
) |
|
static |
Definition at line 48 of file kern_rangelock.c.
Referenced by rangelock_sys_init(), rlqentry_alloc(), and rlqentry_free().