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:
Jim Harris 2017-12-08 12:27:51 -07:00
parent 2c3591f183
commit 8b76ace55f
2 changed files with 9 additions and 18 deletions

View File

@ -44,12 +44,8 @@
* a few general rules regarding thread safety to avoid taking locks * 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 * 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. * 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 * The metadata thread is the thread which called spdk_bs_init() or
* calling \ref spdk_bs_register_md_thread, but by default it is the thread * spdk_bs_load().
* 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.
* *
* Functions starting with the prefix "spdk_bs_io" are passed a channel * 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 * 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. */ /* Get the total number of clusters accessible by user. */
uint64_t spdk_bs_total_data_cluster_count(struct spdk_blob_store *bs); 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 */ /* Return the blobid */
spdk_blob_id spdk_blob_get_id(struct spdk_blob *blob); spdk_blob_id spdk_blob_get_id(struct spdk_blob *blob);

View File

@ -47,6 +47,9 @@
#define BLOB_CRC32C_INITIAL 0xffffffffUL #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 static inline size_t
divide_round_up(size_t num, size_t divisor) 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; 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); bs->md_target.md_channel = spdk_get_io_channel(&bs->md_target);
if (!bs->md_target.md_channel) { if (!bs->md_target.md_channel) {
@ -2543,7 +2547,8 @@ int spdk_bs_register_md_thread(struct spdk_blob_store *bs)
return 0; 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); spdk_put_io_channel(bs->md_target.md_channel);