From 8b76ace55fcd60890e5346b71d345511cd0735a7 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Fri, 8 Dec 2017 12:27:51 -0700 Subject: [PATCH] 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 Change-Id: Idf800a7f061ffc9c42488951262e28e660871356 Reviewed-on: https://review.gerrithub.io/391020 Reviewed-by: Ben Walker Tested-by: SPDK Automated Test System Reviewed-by: Daniel Verkamp --- include/spdk/blob.h | 18 ++---------------- lib/blob/blobstore.c | 9 +++++++-- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/include/spdk/blob.h b/include/spdk/blob.h index 2113137e8..f24851279 100644 --- a/include/spdk/blob.h +++ b/include/spdk/blob.h @@ -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); diff --git a/lib/blob/blobstore.c b/lib/blob/blobstore.c index 801311099..c24f17acc 100644 --- a/lib/blob/blobstore.c +++ b/lib/blob/blobstore.c @@ -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);