blob: clean up some blob->state checks

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I096fb24dd2fe2fc4dd97d80c957c328d960fb867
Reviewed-on: https://review.gerrithub.io/401073
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Jim Harris 2018-02-22 16:38:56 -07:00
parent 4661f2aef3
commit cb42aa1dce

View File

@ -441,7 +441,6 @@ _spdk_blob_parse(const struct spdk_blob_md_page *pages, uint32_t page_count,
assert(blob != NULL);
assert(blob->state == SPDK_BLOB_STATE_LOADING);
assert(blob->active.clusters == NULL);
assert(blob->state == SPDK_BLOB_STATE_LOADING);
/* The blobid provided doesn't match what's in the MD, this can
* happen for example if a bogus blobid is passed in through open.
@ -845,9 +844,7 @@ _spdk_blob_load(spdk_bs_sequence_t *seq, struct spdk_blob *blob,
uint32_t page_num;
uint64_t lba;
assert(blob != NULL);
assert(blob->state == SPDK_BLOB_STATE_CLEAN ||
blob->state == SPDK_BLOB_STATE_DIRTY);
_spdk_blob_verify_md_op(blob);
bs = blob->bs;
@ -1135,7 +1132,7 @@ _spdk_resize_blob(struct spdk_blob *blob, uint64_t sz)
bs = blob->bs;
assert(blob->state != SPDK_BLOB_STATE_LOADING);
_spdk_blob_verify_md_op(blob);
if (blob->active.num_clusters == sz) {
return 0;
@ -1208,9 +1205,7 @@ _spdk_blob_persist(spdk_bs_sequence_t *seq, struct spdk_blob *blob,
uint32_t page_num;
struct spdk_blob_store *bs;
assert(blob != NULL);
assert(blob->state == SPDK_BLOB_STATE_CLEAN ||
blob->state == SPDK_BLOB_STATE_DIRTY);
_spdk_blob_verify_md_op(blob);
if (blob->state == SPDK_BLOB_STATE_CLEAN) {
cb_fn(seq, cb_arg, 0);