#define SPDK_LVOL_H
#include "spdk/stdinc.h"
+#include "spdk/blob.h"
#ifdef __cplusplus
extern "C" {
struct spdk_lvol_store;
struct spdk_lvol;
+enum lvol_clear_method {
+ LVOL_CLEAR_WITH_DEFAULT = BLOB_CLEAR_WITH_DEFAULT,
+ LVOL_CLEAR_WITH_NONE = BLOB_CLEAR_WITH_NONE,
+ LVOL_CLEAR_WITH_UNMAP = BLOB_CLEAR_WITH_UNMAP,
+ LVOL_CLEAR_WITH_WRITE_ZEROES = BLOB_CLEAR_WITH_WRITE_ZEROES,
+};
+
+enum lvs_clear_method {
+ LVS_CLEAR_WITH_UNMAP = BS_CLEAR_WITH_UNMAP,
+ LVS_CLEAR_WITH_WRITE_ZEROES = BS_CLEAR_WITH_WRITE_ZEROES,
+ LVS_CLEAR_WITH_NONE = BS_CLEAR_WITH_NONE,
+};
+
/* Must include null terminator. */
#define SPDK_LVS_NAME_MAX 64
#define SPDK_LVOL_NAME_MAX 64
* Parameters for lvolstore initialization.
*/
struct spdk_lvs_opts {
- uint32_t cluster_sz;
- char name[SPDK_LVS_NAME_MAX];
+ uint32_t cluster_sz;
+ enum lvs_clear_method clear_method;
+ char name[SPDK_LVS_NAME_MAX];
};
/**
* \param name Name of lvol.
* \param sz size of lvol in bytes.
* \param thin_provisioned Enables thin provisioning.
+ * \param clear_method Changes default data clusters clear method
* \param cb_fn Completion callback.
* \param cb_arg Completion callback custom arguments.
*
* \return 0 on success, negative errno on failure.
*/
int spdk_lvol_create(struct spdk_lvol_store *lvs, const char *name, uint64_t sz,
- bool thin_provisioned, spdk_lvol_op_with_handle_complete cb_fn, void *cb_arg);
+ bool thin_provisioned, enum lvol_clear_method clear_method,
+ spdk_lvol_op_with_handle_complete cb_fn, void *cb_arg);
/**
* Create snapshot of given lvol.
*