lib/ftl: minor ftl_rwb_fill cleanup

Change-Id: I69ee623d9e5646b7a793313dac0fb82ef04035f3
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453994
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Konrad Sztyber 2019-05-10 14:41:31 +02:00 committed by Jim Harris
parent 36ff0eeb88
commit bdbd32b4c7

View File

@ -1406,6 +1406,7 @@ ftl_rwb_entry_fill(struct ftl_rwb_entry *entry, struct ftl_io *io)
}
entry->trace = io->trace;
entry->lba = ftl_io_current_lba(io);
if (entry->md) {
memcpy(entry->md, &entry->lba, sizeof(entry->lba));
@ -1419,11 +1420,9 @@ ftl_rwb_fill(struct ftl_io *io)
struct ftl_rwb_entry *entry;
struct ftl_ppa ppa = { .cached = 1 };
int flags = ftl_rwb_flags_from_io(io);
uint64_t lba;
while (io->pos < io->lbk_cnt) {
lba = ftl_io_current_lba(io);
if (lba == FTL_LBA_INVALID) {
if (ftl_io_current_lba(io) == FTL_LBA_INVALID) {
ftl_io_advance(io, 1);
continue;
}
@ -1433,14 +1432,13 @@ ftl_rwb_fill(struct ftl_io *io)
return -EAGAIN;
}
entry->lba = lba;
ftl_rwb_entry_fill(entry, io);
ppa.offset = entry->pos;
ftl_trace_rwb_fill(dev, io);
ftl_io_advance(io, 1);
ftl_update_l2p(dev, entry, ppa);
ftl_io_advance(io, 1);
/* Needs to be done after L2P is updated to avoid race with */
/* write completion callback when it's processed faster than */