lib/ftl: add assert check for ftl_wptr_from_band
Signed-off-by: Weifeng Su <suweifeng1@huawei.com> Signed-off-by: Shihao Sun <sunshihao@huawei.com> Change-Id: Ibba5fcf368ad1fa09f5303135b0cd9bda9bade4d Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5073 Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
eacc9199fc
commit
ced16bcd35
@ -377,7 +377,7 @@ ftl_wptr_from_band(struct ftl_band *band)
|
|||||||
return wptr;
|
return wptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
assert(false);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -389,8 +389,6 @@ ftl_md_write_fail(struct ftl_io *io, int status)
|
|||||||
char buf[128];
|
char buf[128];
|
||||||
|
|
||||||
wptr = ftl_wptr_from_band(band);
|
wptr = ftl_wptr_from_band(band);
|
||||||
assert(wptr);
|
|
||||||
|
|
||||||
SPDK_ERRLOG("Metadata write failed @addr: %s, status: %d\n",
|
SPDK_ERRLOG("Metadata write failed @addr: %s, status: %d\n",
|
||||||
ftl_addr2str(wptr->addr, buf, sizeof(buf)), status);
|
ftl_addr2str(wptr->addr, buf, sizeof(buf)), status);
|
||||||
|
|
||||||
@ -407,7 +405,6 @@ ftl_md_write_cb(struct ftl_io *io, void *arg, int status)
|
|||||||
size_t id;
|
size_t id;
|
||||||
|
|
||||||
wptr = ftl_wptr_from_band(band);
|
wptr = ftl_wptr_from_band(band);
|
||||||
assert(wptr);
|
|
||||||
|
|
||||||
if (status) {
|
if (status) {
|
||||||
ftl_md_write_fail(io, status);
|
ftl_md_write_fail(io, status);
|
||||||
@ -722,7 +719,6 @@ ftl_close_direct_wptr(struct ftl_band *band)
|
|||||||
{
|
{
|
||||||
struct ftl_wptr *wptr = ftl_wptr_from_band(band);
|
struct ftl_wptr *wptr = ftl_wptr_from_band(band);
|
||||||
|
|
||||||
assert(wptr);
|
|
||||||
assert(wptr->direct_mode);
|
assert(wptr->direct_mode);
|
||||||
assert(band->state == FTL_BAND_STATE_CLOSED);
|
assert(band->state == FTL_BAND_STATE_CLOSED);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user