blob: always use _spdk_blob_persist to check for CLEAN state
spdk_blob_close() and spdk_blob_sync_md() currently do their own CLEAN state. To consolidate the state checking code, have both functions rely on the check in _spdk_blob_persist() instead. This will reduce code but more importantly is needed for some upcoming changes for queuing persist operations. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I38118624b4fad6f18c4b7466d9ddfa0915c3fce0 Reviewed-on: https://review.gerrithub.io/401065 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
4f6096fa10
commit
4661f2aef3
@ -3558,11 +3558,6 @@ spdk_blob_sync_md(struct spdk_blob *blob, spdk_blob_op_complete cb_fn, void *cb_
|
||||
return;
|
||||
}
|
||||
|
||||
if (blob->state == SPDK_BLOB_STATE_CLEAN) {
|
||||
cb_fn(cb_arg, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
_spdk_blob_sync_md(blob, cb_fn, cb_arg);
|
||||
}
|
||||
|
||||
@ -3683,11 +3678,6 @@ void spdk_blob_close(struct spdk_blob *blob, spdk_blob_op_complete cb_fn, void *
|
||||
return;
|
||||
}
|
||||
|
||||
if (blob->state == SPDK_BLOB_STATE_CLEAN) {
|
||||
_spdk_blob_close_cpl(seq, blob, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Sync metadata */
|
||||
_spdk_blob_persist(seq, blob, _spdk_blob_close_cpl, blob);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user