blob: move spdk_bs_load_ctx earlier in the file

This prepares for some future patches.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: If63c83f76e839b796c58200ddb0ca2137fbc4288
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3971
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Jim Harris 2020-08-28 10:23:29 -07:00 committed by Tomasz Zawadzki
parent 835fbef712
commit 0a19f43e05

View File

@ -3135,6 +3135,29 @@ bs_opts_verify(struct spdk_bs_opts *opts)
return 0;
}
/* START spdk_bs_load, spdk_bs_load_ctx will used for both load and unload. */
struct spdk_bs_load_ctx {
struct spdk_blob_store *bs;
struct spdk_bs_super_block *super;
struct spdk_bs_md_mask *mask;
bool in_page_chain;
uint32_t page_index;
uint32_t cur_page;
struct spdk_blob_md_page *page;
uint64_t num_extent_pages;
uint32_t *extent_page_num;
struct spdk_blob_md_page *extent_pages;
spdk_bs_sequence_t *seq;
spdk_blob_op_with_handle_complete iter_cb_fn;
void *iter_cb_arg;
struct spdk_blob *blob;
spdk_blob_id blobid;
};
static int
bs_alloc(struct spdk_bs_dev *dev, struct spdk_bs_opts *opts, struct spdk_blob_store **_bs)
{
@ -3214,29 +3237,6 @@ bs_alloc(struct spdk_bs_dev *dev, struct spdk_bs_opts *opts, struct spdk_blob_st
return 0;
}
/* START spdk_bs_load, spdk_bs_load_ctx will used for both load and unload. */
struct spdk_bs_load_ctx {
struct spdk_blob_store *bs;
struct spdk_bs_super_block *super;
struct spdk_bs_md_mask *mask;
bool in_page_chain;
uint32_t page_index;
uint32_t cur_page;
struct spdk_blob_md_page *page;
uint64_t num_extent_pages;
uint32_t *extent_page_num;
struct spdk_blob_md_page *extent_pages;
spdk_bs_sequence_t *seq;
spdk_blob_op_with_handle_complete iter_cb_fn;
void *iter_cb_arg;
struct spdk_blob *blob;
spdk_blob_id blobid;
};
static void
bs_load_ctx_fail(struct spdk_bs_load_ctx *ctx, int bserrno)
{