blob: remove spdk_bs_[un]register_md_thread from public API
The implementations in blobstore.c still remain for now, but those will be removed after some upcoming changes which will eliminate a global md thread and instead allow caller to specify an I/O channel for each blobstore level API call. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: Idf800a7f061ffc9c42488951262e28e660871356 Reviewed-on: https://review.gerrithub.io/391020 Reviewed-by: Ben Walker <benjamin.walker@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
2c3591f183
commit
8b76ace55f
@ -44,12 +44,8 @@
|
||||
* a few general rules regarding thread safety to avoid taking locks
|
||||
* in the I/O path. Functions starting with the prefix "spdk_bs_md" must only
|
||||
* be called from the metadata thread, of which there is only one at a time.
|
||||
* The user application can declare which thread is the metadata thread by
|
||||
* calling \ref spdk_bs_register_md_thread, but by default it is the thread
|
||||
* that was used to create the blobstore initially. The metadata thread can
|
||||
* be changed at run time by first unregistering
|
||||
* (\ref spdk_bs_unregister_md_thread) and then re-registering. Registering
|
||||
* a thread as the metadata thread is expensive and should be avoided.
|
||||
* The metadata thread is the thread which called spdk_bs_init() or
|
||||
* spdk_bs_load().
|
||||
*
|
||||
* Functions starting with the prefix "spdk_bs_io" are passed a channel
|
||||
* as an argument, and channels may only be used from the thread they were
|
||||
@ -201,16 +197,6 @@ uint64_t spdk_bs_free_cluster_count(struct spdk_blob_store *bs);
|
||||
/* Get the total number of clusters accessible by user. */
|
||||
uint64_t spdk_bs_total_data_cluster_count(struct spdk_blob_store *bs);
|
||||
|
||||
/* Register the current thread as the metadata thread. All functions beginning with
|
||||
* the prefix "spdk_bs_md" must be called only from this thread.
|
||||
*/
|
||||
int spdk_bs_register_md_thread(struct spdk_blob_store *bs);
|
||||
|
||||
/* Unregister the current thread as the metadata thread. This allows a different
|
||||
* thread to be registered.
|
||||
*/
|
||||
int spdk_bs_unregister_md_thread(struct spdk_blob_store *bs);
|
||||
|
||||
/* Return the blobid */
|
||||
spdk_blob_id spdk_blob_get_id(struct spdk_blob *blob);
|
||||
|
||||
|
@ -47,6 +47,9 @@
|
||||
|
||||
#define BLOB_CRC32C_INITIAL 0xffffffffUL
|
||||
|
||||
static int spdk_bs_register_md_thread(struct spdk_blob_store *bs);
|
||||
static int spdk_bs_unregister_md_thread(struct spdk_blob_store *bs);
|
||||
|
||||
static inline size_t
|
||||
divide_round_up(size_t num, size_t divisor)
|
||||
{
|
||||
@ -2532,7 +2535,8 @@ spdk_bs_total_data_cluster_count(struct spdk_blob_store *bs)
|
||||
return bs->total_data_clusters;
|
||||
}
|
||||
|
||||
int spdk_bs_register_md_thread(struct spdk_blob_store *bs)
|
||||
static int
|
||||
spdk_bs_register_md_thread(struct spdk_blob_store *bs)
|
||||
{
|
||||
bs->md_target.md_channel = spdk_get_io_channel(&bs->md_target);
|
||||
if (!bs->md_target.md_channel) {
|
||||
@ -2543,7 +2547,8 @@ int spdk_bs_register_md_thread(struct spdk_blob_store *bs)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int spdk_bs_unregister_md_thread(struct spdk_blob_store *bs)
|
||||
static int
|
||||
spdk_bs_unregister_md_thread(struct spdk_blob_store *bs)
|
||||
{
|
||||
spdk_put_io_channel(bs->md_target.md_channel);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user