Commit eb1ddcb6 authored by paul luse's avatar paul luse Committed by Jim Harris
Browse files

lib/reduce: remove dead code clearing unused backing io units



At the start of time all of values of io_unit_index[] array in
the chunk maps are FF's.  When a partial chunk is written, only
some of the io_unit_index[] vals will be assigned values from the
allocated_backing_io_units bit array.  When that chunk is written
again, it is not done so in place and at that time in when
_write_write_done() is called, the io_unit_index[] values are
set to FF again and the bit array bits are cleared for the old
chunk so that it is fresh again for use by another write.

This change removes code from an early stage of the write process
where a 'fresh' chuck in allocated.  Because of points made earlier,
it is not possible for any of the io_unit_index[] values to be
assigned or have a corresponding bit set in the bit array.

The prev version of this patch cleared the bit array because the
io_unit_index[] array was being cleared however after further
investigation, and for the reasons stated earlier, the io_unit_index[]
did not have a valid value so clearing the bit array was simply wrong.

Removing this dead code clears things up and leaves it to one place
to clear the io_unit_index[], when a chunk is overwritten.  Well, 2
places including init time.

Change-Id: I5c4e5360c9c13817d2fa7d3c7d004b44537af7f4
Signed-off-by: default avatarpaul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458520


Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 8df52a0f
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -1066,9 +1066,6 @@ _reduce_vol_write_chunk(struct spdk_reduce_vol_request *req, reduce_request_fn n
		assert(req->chunk->io_unit_index[i] != UINT32_MAX);
		spdk_bit_array_set(vol->allocated_backing_io_units, req->chunk->io_unit_index[i]);
	}
	while (i < vol->backing_io_units_per_chunk) {
		req->chunk->io_unit_index[i++] = REDUCE_EMPTY_MAP_ENTRY;
	}

	_issue_backing_ops(req, vol, next_fn, true /* write */);
}