]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/spdk/include/spdk/blob_bdev.h
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / spdk / include / spdk / blob_bdev.h
index 86fe54bedf06f3c76a115fc0add9f2c2d7b71277..1867c464c18aca8781a30a1f7f681d2256aa357e 100644 (file)
 #ifndef SPDK_BLOB_BDEV_H
 #define SPDK_BLOB_BDEV_H
 
+#include "spdk/stdinc.h"
+#include "spdk/bdev.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 struct spdk_bs_dev;
 struct spdk_bdev;
+struct spdk_bdev_module;
+
+/**
+ * Create a blobstore block device from a bdev. (deprecated, please use spdk_bdev_create_bs_dev_from_desc,
+ * together with spdk_bdev_open_ext).
+ *
+ * \param bdev Bdev to use.
+ * \param remove_cb Called when the block device is removed.
+ * \param remove_ctx Argument passed to function remove_cb.
+ *
+ * \return a pointer to the blobstore block device on success or NULL otherwise.
+ */
+struct spdk_bs_dev *spdk_bdev_create_bs_dev(struct spdk_bdev *bdev, spdk_bdev_remove_cb_t remove_cb,
+               void *remove_ctx);
+
+/**
+ * Create a blobstore block device from the descriptor of a bdev.
+ *
+ * \param desc Descriptor of a bdev. spdk_bdev_open_ext() is recommended to get the desc.
+ *
+ * \return a pointer to the blobstore block device on success or NULL otherwise.
+ */
+struct spdk_bs_dev *spdk_bdev_create_bs_dev_from_desc(struct spdk_bdev_desc *desc);
 
-struct spdk_bs_dev *spdk_bdev_create_bs_dev(struct spdk_bdev *);
+/**
+ * Claim the bdev module for the given blobstore.
+ *
+ * \param bs_dev Blobstore block device.
+ * \param module Bdev module to claim.
+ *
+ * \return 0 on success, negative errno on failure.
+ */
+int spdk_bs_bdev_claim(struct spdk_bs_dev *bs_dev, struct spdk_bdev_module *module);
 
 #ifdef __cplusplus
 }