blob_bdev.h File Reference

Helper library to use spdk_bdev as the backing device for a blobstore. More...

Data Structures

struct  spdk_bdev_bs_dev_opts
 

Functions

 SPDK_STATIC_ASSERT (sizeof(struct spdk_bdev_bs_dev_opts)==8, "Incorrect size")
 
int spdk_bdev_create_bs_dev_ext (const char *bdev_name, spdk_bdev_event_cb_t event_cb, void *event_ctx, struct spdk_bs_dev **bs_dev)
 Create a blobstore block device from a bdev. More...
 
int spdk_bdev_create_bs_dev (const char *bdev_name, bool write, struct spdk_bdev_bs_dev_opts *opts, size_t opts_size, spdk_bdev_event_cb_t event_cb, void *event_ctx, struct spdk_bs_dev **bs_dev)
 Create a blobstore block device from a bdev. More...
 
void spdk_bdev_update_bs_blockcnt (struct spdk_bs_dev *bs_dev)
 Updates number of blocks of a blobstore block device. More...
 
int spdk_bs_bdev_claim (struct spdk_bs_dev *bs_dev, struct spdk_bdev_module *module)
 Claim the bdev module for the given blobstore. More...
 

Detailed Description

Helper library to use spdk_bdev as the backing device for a blobstore.

Function Documentation

◆ spdk_bdev_create_bs_dev()

int spdk_bdev_create_bs_dev ( const char *  bdev_name,
bool  write,
struct spdk_bdev_bs_dev_opts opts,
size_t  opts_size,
spdk_bdev_event_cb_t  event_cb,
void *  event_ctx,
struct spdk_bs_dev **  bs_dev 
)

Create a blobstore block device from a bdev.

Parameters
bdev_nameThe bdev to use.
writeIf true, open device read-write, else open read-only.
optsAdditonal options; none currently supported.
opts_sizeSize of structure referenced by opts.
event_cbCalled when the bdev triggers asynchronous event.
event_ctxArgument passed to function event_cb.
bs_devOutput parameter for a pointer to the blobstore block device.
Returns
0 if operation is successful, or suitable errno value otherwise.

◆ spdk_bdev_create_bs_dev_ext()

int spdk_bdev_create_bs_dev_ext ( const char *  bdev_name,
spdk_bdev_event_cb_t  event_cb,
void *  event_ctx,
struct spdk_bs_dev **  bs_dev 
)

Create a blobstore block device from a bdev.

Parameters
bdev_nameName of the bdev to use.
event_cbCalled when the bdev triggers asynchronous event.
event_ctxArgument passed to function event_cb.
bs_devOutput parameter for a pointer to the blobstore block device.
Returns
0 if operation is successful, or suitable errno value otherwise.

◆ spdk_bdev_update_bs_blockcnt()

void spdk_bdev_update_bs_blockcnt ( struct spdk_bs_dev bs_dev)

Updates number of blocks of a blobstore block device.

Parameters
bs_devBlobstore block device.

◆ spdk_bs_bdev_claim()

int spdk_bs_bdev_claim ( struct spdk_bs_dev bs_dev,
struct spdk_bdev_module module 
)

Claim the bdev module for the given blobstore.

If bs_dev was opened read-write using spdk_bdev_create_bs_dev_ext(), a read-write-once claim is taken. If bs_dev was opened read-only using spdk_bdev_create_bs_dev(), a read-only-many claim is taken.

Parameters
bs_devBlobstore block device.
moduleBdev module to claim.
Returns
0 on success, negative errno on failure.