Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/blist.h
Context not available. | |||||
#ifndef _SYS_BLIST_H_ | #ifndef _SYS_BLIST_H_ | ||||
#define _SYS_BLIST_H_ | #define _SYS_BLIST_H_ | ||||
typedef uint64_t u_daddr_t; /* unsigned disk address */ | typedef uint64_t u_daddr_t; /* unsigned disk address */ | ||||
/* | /* | ||||
* note: currently use SWAPBLK_NONE as an absolute value rather then | * note: currently use SWAPBLK_NONE as an absolute value rather then | ||||
* a flag bit. | * a flag bit. | ||||
*/ | */ | ||||
#define SWAPBLK_MASK ((daddr_t)((u_daddr_t)-1 >> 1)) /* mask */ | #define SWAPBLK_MASK ((daddr_t)((u_daddr_t)-1 >> 1)) /* mask */ | ||||
#define SWAPBLK_NONE ((daddr_t)((u_daddr_t)SWAPBLK_MASK + 1))/* flag */ | #define SWAPBLK_NONE ((daddr_t)((u_daddr_t)SWAPBLK_MASK + 1))/* flag */ | ||||
/* | /* | ||||
* Both blmeta and bmu_bitmap MUST be a power of 2 in size. | * Both blmeta and bm_bitmap MUST be a power of 2 in size. | ||||
*/ | */ | ||||
typedef struct blmeta { | typedef struct blmeta { | ||||
u_daddr_t bm_bitmap; /* bitmap if we are a leaf */ | u_daddr_t bm_bitmap; /* bitmap marking unfilled block sets*/ | ||||
daddr_t bm_bighint; /* biggest contiguous block hint*/ | daddr_t bm_bighint; /* biggest contiguous block hint*/ | ||||
} blmeta_t; | } blmeta_t; | ||||
typedef struct blist { | typedef struct blist { | ||||
daddr_t bl_blocks; /* area of coverage */ | daddr_t bl_blocks; /* area of coverage */ | ||||
daddr_t bl_avail; /* # available blocks */ | daddr_t bl_avail; /* # available blocks */ | ||||
u_daddr_t bl_radix; /* coverage radix */ | u_daddr_t bl_radix; /* coverage radix */ | ||||
daddr_t bl_cursor; /* next-fit search starts at */ | daddr_t bl_cursor; /* next-fit search starts at */ | ||||
blmeta_t bl_root[1]; /* root of radix tree */ | blmeta_t bl_root[1]; /* root of radix tree */ | ||||
} *blist_t; | } *blist_t; | ||||
#define BLIST_BMAP_RADIX (sizeof(u_daddr_t)*8) | #define BLIST_BMAP_RADIX (sizeof(u_daddr_t)*8) | ||||
#define BLIST_META_RADIX BLIST_BMAP_RADIX | #define BLIST_META_RADIX BLIST_BMAP_RADIX | ||||
#define BLIST_MAX_ALLOC BLIST_BMAP_RADIX | #define BLIST_MAX_ALLOC BLIST_BMAP_RADIX | ||||
Context not available. |