Commit bdbd32b4 authored by Konrad Sztyber's avatar Konrad Sztyber Committed by Jim Harris
Browse files

lib/ftl: minor ftl_rwb_fill cleanup



Change-Id: I69ee623d9e5646b7a793313dac0fb82ef04035f3
Signed-off-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453994


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 36ff0eeb
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -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 */