lib/ftl: Change ftl_wptr_ready() return value from int to bool
ftl_wptr_ready() return value is true or false so it should return bool instead int. Change-Id: I653e4ee1271d54f2e8c7b6fa0144a468faec4607 Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/555 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
149511c1a0
commit
c4bda88b25
@ -652,7 +652,7 @@ ftl_wptr_user_blocks_left(const struct ftl_wptr *wptr)
|
|||||||
return ftl_band_user_blocks_left(wptr->band, wptr->offset);
|
return ftl_band_user_blocks_left(wptr->band, wptr->offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static bool
|
||||||
ftl_wptr_ready(struct ftl_wptr *wptr)
|
ftl_wptr_ready(struct ftl_wptr *wptr)
|
||||||
{
|
{
|
||||||
struct ftl_band *band = wptr->band;
|
struct ftl_band *band = wptr->band;
|
||||||
@ -664,14 +664,14 @@ ftl_wptr_ready(struct ftl_wptr *wptr)
|
|||||||
if (spdk_unlikely(wptr->zone->info.state == SPDK_BDEV_ZONE_STATE_OFFLINE)) {
|
if (spdk_unlikely(wptr->zone->info.state == SPDK_BDEV_ZONE_STATE_OFFLINE)) {
|
||||||
ftl_wptr_advance(wptr, wptr->dev->xfer_size);
|
ftl_wptr_advance(wptr, wptr->dev->xfer_size);
|
||||||
}
|
}
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we're in the process of writing metadata, wait till it is */
|
/* If we're in the process of writing metadata, wait till it is */
|
||||||
/* completed. */
|
/* completed. */
|
||||||
/* TODO: we should probably change bands once we're writing tail md */
|
/* TODO: we should probably change bands once we're writing tail md */
|
||||||
if (ftl_band_state_changing(band)) {
|
if (ftl_band_state_changing(band)) {
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (band->state == FTL_BAND_STATE_FULL) {
|
if (band->state == FTL_BAND_STATE_FULL) {
|
||||||
@ -682,7 +682,7 @@ ftl_wptr_ready(struct ftl_wptr *wptr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (band->state != FTL_BAND_STATE_OPEN) {
|
if (band->state != FTL_BAND_STATE_OPEN) {
|
||||||
@ -691,10 +691,10 @@ ftl_wptr_ready(struct ftl_wptr *wptr)
|
|||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
Loading…
Reference in New Issue
Block a user