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:
parent
4661f2aef3
commit
cb42aa1dce
@ -441,7 +441,6 @@ _spdk_blob_parse(const struct spdk_blob_md_page *pages, uint32_t page_count,
|
|||||||
assert(blob != NULL);
|
assert(blob != NULL);
|
||||||
assert(blob->state == SPDK_BLOB_STATE_LOADING);
|
assert(blob->state == SPDK_BLOB_STATE_LOADING);
|
||||||
assert(blob->active.clusters == NULL);
|
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
|
/* 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.
|
* 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;
|
uint32_t page_num;
|
||||||
uint64_t lba;
|
uint64_t lba;
|
||||||
|
|
||||||
assert(blob != NULL);
|
_spdk_blob_verify_md_op(blob);
|
||||||
assert(blob->state == SPDK_BLOB_STATE_CLEAN ||
|
|
||||||
blob->state == SPDK_BLOB_STATE_DIRTY);
|
|
||||||
|
|
||||||
bs = blob->bs;
|
bs = blob->bs;
|
||||||
|
|
||||||
@ -1135,7 +1132,7 @@ _spdk_resize_blob(struct spdk_blob *blob, uint64_t sz)
|
|||||||
|
|
||||||
bs = blob->bs;
|
bs = blob->bs;
|
||||||
|
|
||||||
assert(blob->state != SPDK_BLOB_STATE_LOADING);
|
_spdk_blob_verify_md_op(blob);
|
||||||
|
|
||||||
if (blob->active.num_clusters == sz) {
|
if (blob->active.num_clusters == sz) {
|
||||||
return 0;
|
return 0;
|
||||||
@ -1208,9 +1205,7 @@ _spdk_blob_persist(spdk_bs_sequence_t *seq, struct spdk_blob *blob,
|
|||||||
uint32_t page_num;
|
uint32_t page_num;
|
||||||
struct spdk_blob_store *bs;
|
struct spdk_blob_store *bs;
|
||||||
|
|
||||||
assert(blob != NULL);
|
_spdk_blob_verify_md_op(blob);
|
||||||
assert(blob->state == SPDK_BLOB_STATE_CLEAN ||
|
|
||||||
blob->state == SPDK_BLOB_STATE_DIRTY);
|
|
||||||
|
|
||||||
if (blob->state == SPDK_BLOB_STATE_CLEAN) {
|
if (blob->state == SPDK_BLOB_STATE_CLEAN) {
|
||||||
cb_fn(seq, cb_arg, 0);
|
cb_fn(seq, cb_arg, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user