Motr  M0
m0_ad_balloc_ops Struct Reference

#include <ad.h>

Collaboration diagram for m0_ad_balloc_ops:
Collaboration graph

Data Fields

int(* bo_init )(struct m0_ad_balloc *ballroom, struct m0_be_seg *db, uint32_t bshift, m0_bcount_t container_size, m0_bcount_t blocks_per_group, m0_bcount_t spare_blocks_per_group)
 
void(* bo_fini )(struct m0_ad_balloc *ballroom)
 
int(* bo_alloc )(struct m0_ad_balloc *ballroom, struct m0_dtx *dtx, m0_bcount_t count, struct m0_ext *out, uint64_t alloc_zone)
 
int(* bo_free )(struct m0_ad_balloc *ballroom, struct m0_dtx *dtx, struct m0_ext *ext)
 
void(* bo_alloc_credit )(const struct m0_ad_balloc *ballroom, int nr, struct m0_be_tx_credit *accum)
 
void(* bo_free_credit )(const struct m0_ad_balloc *ballroom, int nr, struct m0_be_tx_credit *accum)
 
int(* bo_reserve_extent )(struct m0_ad_balloc *ballroom, struct m0_be_tx *tx, struct m0_ext *ext, uint64_t alloc_zone)
 

Detailed Description

Definition at line 68 of file ad.h.

Field Documentation

◆ bo_alloc

int(* bo_alloc) (struct m0_ad_balloc *ballroom, struct m0_dtx *dtx, m0_bcount_t count, struct m0_ext *out, uint64_t alloc_zone)

Allocates count of blocks. On success, allocated extent, also measured in blocks, is returned in out parameter.

Definition at line 85 of file ad.h.

◆ bo_alloc_credit

void(* bo_alloc_credit) (const struct m0_ad_balloc *ballroom, int nr, struct m0_be_tx_credit *accum)

Definition at line 92 of file ad.h.

◆ bo_fini

void(* bo_fini) (struct m0_ad_balloc *ballroom)

Finalises and destroys struct m0_balloc instance.

Definition at line 82 of file ad.h.

◆ bo_free

int(* bo_free) (struct m0_ad_balloc *ballroom, struct m0_dtx *dtx, struct m0_ext *ext)

Free space (possibly a sub-extent of an extent allocated earlier).

Definition at line 90 of file ad.h.

◆ bo_free_credit

void(* bo_free_credit) (const struct m0_ad_balloc *ballroom, int nr, struct m0_be_tx_credit *accum)

Definition at line 94 of file ad.h.

◆ bo_init

int(* bo_init) (struct m0_ad_balloc *ballroom, struct m0_be_seg *db, uint32_t bshift, m0_bcount_t container_size, m0_bcount_t blocks_per_group, m0_bcount_t spare_blocks_per_group)

Initialises this balloc instance, creating its persistent state, if necessary. This also destroys allocated struct m0_balloc instance on failure.

Parameters
blocksize shift in bytes, similarly to m0_stob_block_shift()
container_sizeTotal size of the container in bytes
blocks_per_group# of blocks per group

Definition at line 77 of file ad.h.

◆ bo_reserve_extent

int(* bo_reserve_extent) (struct m0_ad_balloc *ballroom, struct m0_be_tx *tx, struct m0_ext *ext, uint64_t alloc_zone)

Marks given extent as used in the allocator.

Return values
0on success.
-ENOSPCon not enough space in superblock/group/fragment.
-EEXISTon overlap extent.
-errnoon other errors.

Definition at line 104 of file ad.h.


The documentation for this struct was generated from the following file: