From 893ad78814df3c7a173532f107d9720d2f8d2d2d Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Fri, 28 Jan 2022 16:21:04 +0000 Subject: [PATCH] blob: clarify that the blob is open in the iter_cb Signed-off-by: Jim Harris Change-Id: I543c3c2d54967884d704fc80214f0a1d6aa2db60 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11355 Tested-by: SPDK CI Jenkins Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Reviewed-by: Paul Luse Reviewed-by: Ben Walker Reviewed-by: Tomasz Zawadzki --- include/spdk/blob.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/spdk/blob.h b/include/spdk/blob.h index 6c02480fa..66dbf8101 100644 --- a/include/spdk/blob.h +++ b/include/spdk/blob.h @@ -809,6 +809,13 @@ void spdk_blob_io_write_zeroes(struct spdk_blob *blob, struct spdk_io_channel *c * Get the first blob of the blobstore. The obtained blob will be passed to * the callback function. * + * The user's cb_fn will be called with rc == -ENOENT when the iteration is + * complete. + * + * When the user's cb_fn is called with rc == 0, the associated blob is open. + * This means that the cb_fn may not attempt to unload the blobstore. It + * must complete the iteration before attempting to unload. + * * \param bs blobstore to traverse. * \param cb_fn Called when the operation is complete. * \param cb_arg Argument passed to function cb_fn. @@ -820,6 +827,13 @@ void spdk_bs_iter_first(struct spdk_blob_store *bs, * Get the next blob by using the current blob. The obtained blob will be passed * to the callback function. * + * The user's cb_fn will be called with rc == -ENOENT when the iteration is + * complete. + * + * When the user's cb_fn is called with rc == 0, the associated blob is open. + * This means that the cb_fn may not attempt to unload the blobstore. It + * must complete the iteration before attempting to unload. + * * \param bs blobstore to traverse. * \param blob The current blob. * \param cb_fn Called when the operation is complete.