FreeBSD kernel kern code
|
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/lock.h>
#include <sys/kernel.h>
#include <sys/blist.h>
#include <sys/malloc.h>
#include <sys/sbuf.h>
#include <sys/proc.h>
#include <sys/mutex.h>
Go to the source code of this file.
Data Structures | |
struct | gap_stats |
Macros | |
#define | BLIST_MASK (BLIST_RADIX - 1) |
Functions | |
__FBSDID ("$FreeBSD$") | |
static daddr_t | blst_leaf_alloc (blmeta_t *scan, daddr_t blk, int *count, int maxcount) |
static daddr_t | blst_meta_alloc (blmeta_t *scan, daddr_t cursor, int *count, int maxcount, u_daddr_t radix) |
static void | blst_leaf_free (blmeta_t *scan, daddr_t relblk, int count) |
static void | blst_meta_free (blmeta_t *scan, daddr_t freeBlk, daddr_t count, u_daddr_t radix) |
static void | blst_copy (blmeta_t *scan, daddr_t blk, daddr_t radix, blist_t dest, daddr_t count) |
static daddr_t | blst_leaf_fill (blmeta_t *scan, daddr_t blk, int count) |
static daddr_t | blst_meta_fill (blmeta_t *scan, daddr_t allocBlk, daddr_t count, u_daddr_t radix) |
static | MALLOC_DEFINE (M_SWAP, "SWAP", "Swap space") |
static daddr_t | radix_to_skip (daddr_t radix) |
static u_daddr_t | bitrange (int n, int count) |
static int | generic_bitpos (u_daddr_t mask) |
static int | bitpos (u_daddr_t mask) |
blist_t | blist_create (daddr_t blocks, int flags) |
void | blist_destroy (blist_t bl) |
daddr_t | blist_alloc (blist_t bl, int *count, int maxcount) |
daddr_t | blist_avail (blist_t bl) |
void | blist_free (blist_t bl, daddr_t blkno, daddr_t count) |
daddr_t | blist_fill (blist_t bl, daddr_t blkno, daddr_t count) |
void | blist_resize (blist_t *pbl, daddr_t count, int freenew, int flags) |
static bool | gap_stats_counting (const struct gap_stats *stats) |
static void | init_gap_stats (struct gap_stats *stats) |
static void | update_gap_stats (struct gap_stats *stats, daddr_t posn) |
static void | dump_gap_stats (const struct gap_stats *stats, struct sbuf *s) |
void | blist_stats (blist_t bl, struct sbuf *s) |
static int | blst_next_leaf_alloc (blmeta_t *scan, daddr_t start, int count, int maxcount) |
Variables | |
static const u_daddr_t | fib [] |
#define BLIST_MASK (BLIST_RADIX - 1) |
Definition at line 153 of file subr_blist.c.
__FBSDID | ( | "$FreeBSD$" | ) |
|
inlinestatic |
Definition at line 208 of file subr_blist.c.
References generic_bitpos(), and mask.
Referenced by blist_stats(), blst_leaf_alloc(), blst_meta_alloc(), and blst_next_leaf_alloc().
|
inlinestatic |
Definition at line 180 of file subr_blist.c.
References count.
Referenced by blist_stats(), blst_leaf_alloc(), blst_leaf_fill(), blst_leaf_free(), blst_meta_alloc(), blst_meta_free(), and generic_bitpos().
daddr_t blist_alloc | ( | blist_t | bl, |
int * | count, | ||
int | maxcount | ||
) |
Definition at line 294 of file subr_blist.c.
References blst_meta_alloc(), count, and maxcount.
daddr_t blist_avail | ( | blist_t | bl | ) |
Definition at line 328 of file subr_blist.c.
blist_t blist_create | ( | daddr_t | blocks, |
int | flags | ||
) |
Definition at line 236 of file subr_blist.c.
References flags, malloc(), and printf().
Referenced by blist_resize().
void blist_destroy | ( | blist_t | bl | ) |
Definition at line 282 of file subr_blist.c.
References free().
Referenced by blist_resize().
daddr_t blist_fill | ( | blist_t | bl, |
daddr_t | blkno, | ||
daddr_t | count | ||
) |
Definition at line 356 of file subr_blist.c.
References blst_meta_fill(), and count.
void blist_free | ( | blist_t | bl, |
daddr_t | blkno, | ||
daddr_t | count | ||
) |
Definition at line 339 of file subr_blist.c.
References blst_meta_free(), and count.
Referenced by blist_resize(), and blst_copy().
void blist_resize | ( | blist_t * | pbl, |
daddr_t | count, | ||
int | freenew, | ||
int | flags | ||
) |
Definition at line 376 of file subr_blist.c.
References blist_create(), blist_destroy(), blist_free(), blst_copy(), count, and flags.
void blist_stats | ( | blist_t | bl, |
struct sbuf * | s | ||
) |
Definition at line 539 of file subr_blist.c.
References bitpos(), bitrange(), BLIST_MASK, dump_gap_stats(), gap_stats_counting(), init_gap_stats(), mask, radix_to_skip(), and update_gap_stats().
|
static |
Definition at line 942 of file subr_blist.c.
References blist_free(), blst_copy(), count, and radix_to_skip().
Referenced by blist_resize(), and blst_copy().
|
static |
Definition at line 700 of file subr_blist.c.
References bitpos(), bitrange(), BLIST_MASK, blst_next_leaf_alloc(), count, mask, and maxcount.
Referenced by blst_meta_alloc().
|
static |
Definition at line 998 of file subr_blist.c.
References bitrange(), BLIST_MASK, count, and mask.
Referenced by blst_meta_fill().
|
static |
Definition at line 870 of file subr_blist.c.
References bitrange(), BLIST_MASK, count, and mask.
Referenced by blst_meta_free().
|
static |
Definition at line 802 of file subr_blist.c.
References bitpos(), bitrange(), BLIST_MASK, blst_leaf_alloc(), blst_meta_alloc(), count, mask, maxcount, and radix_to_skip().
Referenced by blist_alloc(), and blst_meta_alloc().
|
static |
Definition at line 1021 of file subr_blist.c.
References BLIST_MASK, blst_leaf_fill(), blst_meta_fill(), count, and radix_to_skip().
Referenced by blist_fill(), and blst_meta_fill().
|
static |
Definition at line 898 of file subr_blist.c.
References bitrange(), BLIST_MASK, blst_leaf_free(), blst_meta_free(), count, and radix_to_skip().
Referenced by blist_free(), and blst_meta_free().
|
static |
Definition at line 618 of file subr_blist.c.
References bitpos(), BLIST_MASK, count, maxcount, radix_to_skip(), and start.
Referenced by blst_leaf_alloc().
|
inlinestatic |
Definition at line 504 of file subr_blist.c.
References gap_stats::avg, fib, gap_stats::histo, gap_stats::max, gap_stats::max_bucket, gap_stats::num, and sbuf_printf().
Referenced by blist_stats().
|
inlinestatic |
Definition at line 437 of file subr_blist.c.
References gap_stats::start.
Referenced by blist_stats(), and update_gap_stats().
|
inlinestatic |
Definition at line 191 of file subr_blist.c.
References bitrange(), and mask.
Referenced by bitpos().
|
inlinestatic |
Definition at line 447 of file subr_blist.c.
References gap_stats::start.
Referenced by blist_stats().
|
static |
|
inlinestatic |
Definition at line 170 of file subr_blist.c.
References BLIST_MASK.
Referenced by blist_stats(), blst_copy(), blst_meta_alloc(), blst_meta_fill(), blst_meta_free(), and blst_next_leaf_alloc().
|
static |
Definition at line 458 of file subr_blist.c.
References gap_stats::avg, gap_stats::err, fib, gap_stats_counting(), gap_stats::histo, gap_stats::max, gap_stats::max_bucket, gap_stats::num, and gap_stats::start.
Referenced by blist_stats().
|
static |
Definition at line 413 of file subr_blist.c.
Referenced by dump_gap_stats(), and update_gap_stats().