]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/spdk/include/spdk/lvol.h
import 15.2.0 Octopus source
[ceph.git] / ceph / src / spdk / include / spdk / lvol.h
index 279b4dfd3c50c69288065bf49e0afc317a3fad0b..ca271a638270f3775ac4f30dd58ce57759069c3e 100644 (file)
@@ -39,6 +39,7 @@
 #define SPDK_LVOL_H
 
 #include "spdk/stdinc.h"
+#include "spdk/blob.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -48,6 +49,19 @@ struct spdk_bs_dev;
 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
@@ -56,8 +70,9 @@ struct spdk_lvol;
  * 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];
 };
 
 /**
@@ -164,13 +179,15 @@ int spdk_lvs_destroy(struct spdk_lvol_store *lvol_store,
  * \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.
  *