Changeset View
Changeset View
Standalone View
Standalone View
sys/contrib/openzfs/include/sys/abd_impl.h
Context not available. | |||||
extern "C" { | extern "C" { | ||||
#endif | #endif | ||||
typedef enum abd_flags { | |||||
ABD_FLAG_LINEAR = 1 << 0, /* is buffer linear (or scattered)? */ | |||||
ABD_FLAG_OWNER = 1 << 1, /* does it own its data buffers? */ | |||||
ABD_FLAG_META = 1 << 2, /* does this represent FS metadata? */ | |||||
ABD_FLAG_MULTI_ZONE = 1 << 3, /* pages split over memory zones */ | |||||
ABD_FLAG_MULTI_CHUNK = 1 << 4, /* pages split over multiple chunks */ | |||||
ABD_FLAG_LINEAR_PAGE = 1 << 5, /* linear but allocd from page */ | |||||
ABD_FLAG_GANG = 1 << 6, /* mult ABDs chained together */ | |||||
ABD_FLAG_GANG_FREE = 1 << 7, /* gang ABD is responsible for mem */ | |||||
ABD_FLAG_ZEROS = 1 << 8, /* ABD for zero-filled buffer */ | |||||
} abd_flags_t; | |||||
typedef enum abd_stats_op { | typedef enum abd_stats_op { | ||||
ABDSTAT_INCR, /* Increase abdstat values */ | ABDSTAT_INCR, /* Increase abdstat values */ | ||||
ABDSTAT_DECR /* Decrease abdstat values */ | ABDSTAT_DECR /* Decrease abdstat values */ | ||||
} abd_stats_op_t; | } abd_stats_op_t; | ||||
struct abd { | |||||
abd_flags_t abd_flags; | |||||
uint_t abd_size; /* excludes scattered abd_offset */ | |||||
list_node_t abd_gang_link; | |||||
struct abd *abd_parent; | |||||
zfs_refcount_t abd_children; | |||||
kmutex_t abd_mtx; | |||||
union { | |||||
struct abd_scatter { | |||||
uint_t abd_offset; | |||||
#if defined(__FreeBSD__) && defined(_KERNEL) | |||||
uint_t abd_chunk_size; | |||||
void *abd_chunks[]; | |||||
#else | |||||
uint_t abd_nents; | |||||
struct scatterlist *abd_sgl; | |||||
#endif | |||||
} abd_scatter; | |||||
struct abd_linear { | |||||
void *abd_buf; | |||||
struct scatterlist *abd_sgl; /* for LINEAR_PAGE */ | |||||
} abd_linear; | |||||
struct abd_gang { | |||||
list_t abd_gang_chain; | |||||
} abd_gang; | |||||
} abd_u; | |||||
}; | |||||
struct scatterlist; /* forward declaration */ | struct scatterlist; /* forward declaration */ | ||||
struct abd_iter { | struct abd_iter { | ||||
Context not available. | |||||
extern abd_t *abd_zero_scatter; | extern abd_t *abd_zero_scatter; | ||||
abd_t *abd_gang_get_offset(abd_t *, size_t *); | abd_t *abd_gang_get_offset(abd_t *, size_t *); | ||||
abd_t *abd_alloc_struct(size_t); | |||||
void abd_free_struct(abd_t *); | |||||
/* | /* | ||||
* OS specific functions | * OS specific functions | ||||
*/ | */ | ||||
abd_t *abd_alloc_struct(size_t); | abd_t *abd_alloc_struct_impl(size_t); | ||||
abd_t *abd_get_offset_scatter(abd_t *, size_t); | abd_t *abd_get_offset_scatter(abd_t *, abd_t *, size_t); | ||||
void abd_free_struct(abd_t *); | void abd_free_struct_impl(abd_t *); | ||||
void abd_alloc_chunks(abd_t *, size_t); | void abd_alloc_chunks(abd_t *, size_t); | ||||
void abd_free_chunks(abd_t *); | void abd_free_chunks(abd_t *); | ||||
boolean_t abd_size_alloc_linear(size_t); | boolean_t abd_size_alloc_linear(size_t); | ||||
Context not available. |