nvm_sgl - Scather/Gather Lists

When using the nvm_cmd option NVM_CMD_SGL, then use these functions to manage the Scather/Gather Lists.

nvm_sgl

struct nvm_sgl

Opaque handle for a Scatter Gather List (SGL).

nvm_sgl_add

void nvm_sgl_add(struct nvm_sgl * sgl, void * buf, size_t nbytes)

Add an entry to the SGL.

See
nvm_sgl_alloc
See
nvm_buf_alloc
Parameters
  • sgl: Pointer to sgl as allocated by nvm_sgl_alloc
  • buf: Pointer to buffer as allocated with nvm_buf_alloc
  • nbytes: Size of the given buffer in bytes

nvm_sgl_alloc

struct nvm_sgl* nvm_sgl_alloc(void)

Allocate a SGL.

See
nvm_sgl_add
See
nvm_sgl_free
Return
An initialized (empty) SGL.

nvm_sgl_free

void nvm_sgl_free(struct nvm_sgl * sgl)

De-allocate an SGL.

See
nvm_sgl_alloc
Parameters
  • sgl: Pointer to sgl as allocated by nvm_sgl_alloc