Logical Volume Interface. More...
Data Structures | |
struct | spdk_lvs_opts |
Parameters for lvolstore initialization. More... | |
Macros | |
#define | SPDK_LVS_NAME_MAX 64 |
#define | SPDK_LVOL_NAME_MAX 64 |
Typedefs | |
typedef void(* | spdk_lvs_op_with_handle_complete) (void *cb_arg, struct spdk_lvol_store *lvol_store, int lvserrno) |
Callback definition for lvolstore operations, including handle to lvs. More... | |
typedef void(* | spdk_lvs_op_complete) (void *cb_arg, int lvserrno) |
Callback definition for lvolstore operations without handle. More... | |
typedef void(* | spdk_lvol_op_with_handle_complete) (void *cb_arg, struct spdk_lvol *lvol, int lvolerrno) |
Callback definition for lvol operations with handle to lvol. More... | |
typedef void(* | spdk_lvol_op_complete) (void *cb_arg, int lvolerrno) |
Callback definition for lvol operations without handle to lvol. More... | |
typedef int(* | spdk_lvol_iter_cb) (void *cb_arg, struct spdk_lvol *lvol) |
Callback definition for spdk_lvol_iter_clones. More... | |
Functions | |
SPDK_STATIC_ASSERT (sizeof(struct spdk_lvs_opts)==88, "Incorrect size") | |
void | spdk_lvs_opts_init (struct spdk_lvs_opts *opts) |
Initialize an spdk_lvs_opts structure to the defaults. More... | |
int | spdk_lvs_init (struct spdk_bs_dev *bs_dev, struct spdk_lvs_opts *o, spdk_lvs_op_with_handle_complete cb_fn, void *cb_arg) |
Initialize lvolstore on given bs_bdev. More... | |
void | spdk_lvs_rename (struct spdk_lvol_store *lvs, const char *new_name, spdk_lvs_op_complete cb_fn, void *cb_arg) |
Rename the given lvolstore. More... | |
int | spdk_lvs_unload (struct spdk_lvol_store *lvol_store, spdk_lvs_op_complete cb_fn, void *cb_arg) |
Unload lvolstore. More... | |
int | spdk_lvs_destroy (struct spdk_lvol_store *lvol_store, spdk_lvs_op_complete cb_fn, void *cb_arg) |
Destroy lvolstore. More... | |
int | spdk_lvol_create (struct spdk_lvol_store *lvs, const char *name, uint64_t sz, bool thin_provisioned, enum lvol_clear_method clear_method, spdk_lvol_op_with_handle_complete cb_fn, void *cb_arg) |
Create lvol on given lvolstore with specified size. More... | |
void | spdk_lvol_create_snapshot (struct spdk_lvol *lvol, const char *snapshot_name, spdk_lvol_op_with_handle_complete cb_fn, void *cb_arg) |
Create snapshot of given lvol. More... | |
void | spdk_lvol_create_clone (struct spdk_lvol *lvol, const char *clone_name, spdk_lvol_op_with_handle_complete cb_fn, void *cb_arg) |
Create clone of given snapshot. More... | |
int | spdk_lvol_create_esnap_clone (const void *esnap_id, uint32_t id_len, uint64_t size_bytes, struct spdk_lvol_store *lvs, const char *clone_name, spdk_lvol_op_with_handle_complete cb_fn, void *cb_arg) |
void | spdk_lvol_rename (struct spdk_lvol *lvol, const char *new_name, spdk_lvol_op_complete cb_fn, void *cb_arg) |
Rename lvol with new_name. More... | |
bool | spdk_lvol_deletable (struct spdk_lvol *lvol) |
Returns if it is possible to delete an lvol (i.e. More... | |
void | spdk_lvol_destroy (struct spdk_lvol *lvol, spdk_lvol_op_complete cb_fn, void *cb_arg) |
Close lvol and remove information about lvol from its lvolstore. More... | |
void | spdk_lvol_close (struct spdk_lvol *lvol, spdk_lvol_op_complete cb_fn, void *cb_arg) |
Close lvol, but information is kept on lvolstore. More... | |
int | spdk_lvol_iter_immediate_clones (struct spdk_lvol *lvol, spdk_lvol_iter_cb cb_fn, void *cb_arg) |
Iterate clones of an lvol. More... | |
struct spdk_lvol * | spdk_lvol_get_by_uuid (const struct spdk_uuid *uuid) |
Get the lvol that has a particular UUID. More... | |
struct spdk_lvol * | spdk_lvol_get_by_names (const char *lvs_name, const char *lvol_name) |
Get the lvol that has the specified name in the specified lvolstore. More... | |
struct spdk_io_channel * | spdk_lvol_get_io_channel (struct spdk_lvol *lvol) |
Get I/O channel of bdev associated with specified lvol. More... | |
void | spdk_lvs_load (struct spdk_bs_dev *bs_dev, spdk_lvs_op_with_handle_complete cb_fn, void *cb_arg) |
Load lvolstore from the given blobstore device. More... | |
void | spdk_lvs_load_ext (struct spdk_bs_dev *bs_dev, const struct spdk_lvs_opts *lvs_opts, spdk_lvs_op_with_handle_complete cb_fn, void *cb_arg) |
Load lvolstore from the given blobstore device with options. More... | |
void | spdk_lvs_grow (struct spdk_bs_dev *bs_dev, spdk_lvs_op_with_handle_complete cb_fn, void *cb_arg) |
Grow a lvstore to fill the underlying device. More... | |
void | spdk_lvs_grow_live (struct spdk_lvol_store *lvs, spdk_lvs_op_complete cb_fn, void *cb_arg) |
Grow a loaded lvstore to fill the underlying device. More... | |
void | spdk_lvol_open (struct spdk_lvol *lvol, spdk_lvol_op_with_handle_complete cb_fn, void *cb_arg) |
Open a lvol. More... | |
void | spdk_lvol_inflate (struct spdk_lvol *lvol, spdk_lvol_op_complete cb_fn, void *cb_arg) |
Inflate lvol. More... | |
void | spdk_lvol_decouple_parent (struct spdk_lvol *lvol, spdk_lvol_op_complete cb_fn, void *cb_arg) |
Decouple parent of lvol. More... | |
bool | spdk_lvol_is_degraded (const struct spdk_lvol *lvol) |
Determine if an lvol is degraded. More... | |
Logical Volume Interface.
typedef int(* spdk_lvol_iter_cb) (void *cb_arg, struct spdk_lvol *lvol) |
Callback definition for spdk_lvol_iter_clones.
lvol | An iterated lvol. |
cb_arg | Opaque context passed to spdk_lvol_iter_clone(). |
typedef void(* spdk_lvol_op_complete) (void *cb_arg, int lvolerrno) |
Callback definition for lvol operations without handle to lvol.
cb_arg | Custom arguments |
lvolerrno | Error |
typedef void(* spdk_lvol_op_with_handle_complete) (void *cb_arg, struct spdk_lvol *lvol, int lvolerrno) |
Callback definition for lvol operations with handle to lvol.
cb_arg | Custom arguments |
lvol | Handle to lvol or NULL when lvserrno is set |
lvolerrno | Error |
typedef void(* spdk_lvs_op_complete) (void *cb_arg, int lvserrno) |
Callback definition for lvolstore operations without handle.
cb_arg | Custom arguments |
lvserrno | Error |
typedef void(* spdk_lvs_op_with_handle_complete) (void *cb_arg, struct spdk_lvol_store *lvol_store, int lvserrno) |
Callback definition for lvolstore operations, including handle to lvs.
cb_arg | Custom arguments |
lvol_store | Handle to lvol_store or NULL when lvserrno is set |
lvserrno | Error |
void spdk_lvol_close | ( | struct spdk_lvol * | lvol, |
spdk_lvol_op_complete | cb_fn, | ||
void * | cb_arg | ||
) |
Close lvol, but information is kept on lvolstore.
lvol | Handle to lvol. |
cb_fn | Completion callback. |
cb_arg | Completion callback custom arguments. |
int spdk_lvol_create | ( | struct spdk_lvol_store * | lvs, |
const char * | name, | ||
uint64_t | sz, | ||
bool | thin_provisioned, | ||
enum lvol_clear_method | clear_method, | ||
spdk_lvol_op_with_handle_complete | cb_fn, | ||
void * | cb_arg | ||
) |
Create lvol on given lvolstore with specified size.
lvs | Handle to lvolstore. |
name | Name of lvol. |
sz | size of lvol in bytes. |
thin_provisioned | Enables thin provisioning. |
clear_method | Changes default data clusters clear method |
cb_fn | Completion callback. |
cb_arg | Completion callback custom arguments. |
void spdk_lvol_create_clone | ( | struct spdk_lvol * | lvol, |
const char * | clone_name, | ||
spdk_lvol_op_with_handle_complete | cb_fn, | ||
void * | cb_arg | ||
) |
Create clone of given snapshot.
lvol | Handle to lvol snapshot. |
clone_name | Name of created clone. |
cb_fn | Completion callback. |
cb_arg | Completion callback custom arguments. |
void spdk_lvol_create_snapshot | ( | struct spdk_lvol * | lvol, |
const char * | snapshot_name, | ||
spdk_lvol_op_with_handle_complete | cb_fn, | ||
void * | cb_arg | ||
) |
Create snapshot of given lvol.
lvol | Handle to lvol. |
snapshot_name | Name of created snapshot. |
cb_fn | Completion callback. |
cb_arg | Completion callback custom arguments. |
void spdk_lvol_decouple_parent | ( | struct spdk_lvol * | lvol, |
spdk_lvol_op_complete | cb_fn, | ||
void * | cb_arg | ||
) |
Decouple parent of lvol.
lvol | Handle to lvol |
cb_fn | Completion callback |
cb_arg | Completion callback custom arguments |
bool spdk_lvol_deletable | ( | struct spdk_lvol * | lvol | ) |
Returns if it is possible to delete an lvol (i.e.
lvol is not a snapshot that have at least one clone).
lvol | Handle to lvol |
void spdk_lvol_destroy | ( | struct spdk_lvol * | lvol, |
spdk_lvol_op_complete | cb_fn, | ||
void * | cb_arg | ||
) |
Close lvol and remove information about lvol from its lvolstore.
lvol | Handle to lvol. |
cb_fn | Completion callback. |
cb_arg | Completion callback custom arguments. |
struct spdk_lvol* spdk_lvol_get_by_names | ( | const char * | lvs_name, |
const char * | lvol_name | ||
) |
Get the lvol that has the specified name in the specified lvolstore.
lvs_name | Name of the lvolstore. |
lvol_name | Name ofthe lvol. |
struct spdk_lvol* spdk_lvol_get_by_uuid | ( | const struct spdk_uuid * | uuid | ) |
Get the lvol that has a particular UUID.
uuid | The lvol's UUID. |
struct spdk_io_channel* spdk_lvol_get_io_channel | ( | struct spdk_lvol * | lvol | ) |
Get I/O channel of bdev associated with specified lvol.
lvol | Handle to lvol. |
void spdk_lvol_inflate | ( | struct spdk_lvol * | lvol, |
spdk_lvol_op_complete | cb_fn, | ||
void * | cb_arg | ||
) |
Inflate lvol.
lvol | Handle to lvol |
cb_fn | Completion callback |
cb_arg | Completion callback custom arguments |
bool spdk_lvol_is_degraded | ( | const struct spdk_lvol * | lvol | ) |
Determine if an lvol is degraded.
A degraded lvol cannot perform IO.
lvol | Handle to lvol |
int spdk_lvol_iter_immediate_clones | ( | struct spdk_lvol * | lvol, |
spdk_lvol_iter_cb | cb_fn, | ||
void * | cb_arg | ||
) |
Iterate clones of an lvol.
Iteration stops if cb_fn(cb_arg, clone_lvol) returns non-zero.
lvol | Handle to lvol. |
cb_fn | Function to call for each lvol that clones this lvol. |
cb_arg | Context to pass wtih cb_fn. |
void spdk_lvol_open | ( | struct spdk_lvol * | lvol, |
spdk_lvol_op_with_handle_complete | cb_fn, | ||
void * | cb_arg | ||
) |
Open a lvol.
lvol | Handle to lvol. |
cb_fn | Completion callback. |
cb_arg | Completion callback custom arguments. |
void spdk_lvol_rename | ( | struct spdk_lvol * | lvol, |
const char * | new_name, | ||
spdk_lvol_op_complete | cb_fn, | ||
void * | cb_arg | ||
) |
Rename lvol with new_name.
lvol | Handle to lvol. |
new_name | new name for lvol. |
cb_fn | Completion callback. |
cb_arg | Completion callback custom arguments. |
int spdk_lvs_destroy | ( | struct spdk_lvol_store * | lvol_store, |
spdk_lvs_op_complete | cb_fn, | ||
void * | cb_arg | ||
) |
Destroy lvolstore.
All lvols have to be closed beforehand, when doing destroy.
lvol_store | Handle to lvolstore. |
cb_fn | Completion callback. |
cb_arg | Completion callback custom arguments. |
void spdk_lvs_grow | ( | struct spdk_bs_dev * | bs_dev, |
spdk_lvs_op_with_handle_complete | cb_fn, | ||
void * | cb_arg | ||
) |
Grow a lvstore to fill the underlying device.
Cannot be used on loaded lvstore.
bs_dev | Pointer to the blobstore device. |
cb_fn | Completion callback. |
cb_arg | Completion callback custom arguments. |
void spdk_lvs_grow_live | ( | struct spdk_lvol_store * | lvs, |
spdk_lvs_op_complete | cb_fn, | ||
void * | cb_arg | ||
) |
Grow a loaded lvstore to fill the underlying device.
lvs | Pointer to lvolstore. |
cb_fn | Completion callback. |
cb_arg | Completion callback custom arguments. |
int spdk_lvs_init | ( | struct spdk_bs_dev * | bs_dev, |
struct spdk_lvs_opts * | o, | ||
spdk_lvs_op_with_handle_complete | cb_fn, | ||
void * | cb_arg | ||
) |
Initialize lvolstore on given bs_bdev.
bs_dev | This is created on the given bdev by using spdk_bdev_create_bs_dev() beforehand. |
o | Options for lvolstore. |
cb_fn | Completion callback. |
cb_arg | Completion callback custom arguments. |
void spdk_lvs_load | ( | struct spdk_bs_dev * | bs_dev, |
spdk_lvs_op_with_handle_complete | cb_fn, | ||
void * | cb_arg | ||
) |
Load lvolstore from the given blobstore device.
bs_dev | Pointer to the blobstore device. |
cb_fn | Completion callback. |
cb_arg | Completion callback custom arguments. |
void spdk_lvs_load_ext | ( | struct spdk_bs_dev * | bs_dev, |
const struct spdk_lvs_opts * | lvs_opts, | ||
spdk_lvs_op_with_handle_complete | cb_fn, | ||
void * | cb_arg | ||
) |
Load lvolstore from the given blobstore device with options.
If lvs_opts is not NULL, it should be initalized with spdk_lvs_opts_init().
bs_dev | Pointer to the blobstore device. |
lvs_opts | lvolstore options. |
cb_fn | Completion callback. |
cb_arg | Completion callback custom arguments. blobstore. |
void spdk_lvs_opts_init | ( | struct spdk_lvs_opts * | opts | ) |
Initialize an spdk_lvs_opts structure to the defaults.
opts | Pointer to the spdk_lvs_opts structure to initialize. |
void spdk_lvs_rename | ( | struct spdk_lvol_store * | lvs, |
const char * | new_name, | ||
spdk_lvs_op_complete | cb_fn, | ||
void * | cb_arg | ||
) |
Rename the given lvolstore.
lvs | Pointer to lvolstore. |
new_name | New name of lvs. |
cb_fn | Completion callback. |
cb_arg | Completion callback custom arguments. |
int spdk_lvs_unload | ( | struct spdk_lvol_store * | lvol_store, |
spdk_lvs_op_complete | cb_fn, | ||
void * | cb_arg | ||
) |
Unload lvolstore.
All lvols have to be closed beforehand, when doing unload.
lvol_store | Handle to lvolstore. |
cb_fn | Completion callback. |
cb_arg | Completion callback custom arguments. |