Commit 63d9d2e2 authored by paul luse's avatar paul luse Committed by Darek Stojaczyk
Browse files

lib/reduce: eliminate RMW on writes with chunk_size length

parent d23c36a1
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -1363,13 +1363,14 @@ _start_writev_request(struct spdk_reduce_vol_request *req)

	TAILQ_INSERT_TAIL(&req->vol->executing_requests, req, tailq);
	if (vol->pm_logical_map[req->logical_map_index] != REDUCE_EMPTY_MAP_ENTRY) {
		/* Read old chunk, then overwrite with data from this write operation.
		 * TODO: bypass reading old chunk if this write operation overwrites
		 * the entire chunk.
		if ((req->length * vol->params.logical_block_size) < vol->params.chunk_size) {
			/* Read old chunk, then overwrite with data from this write
			 *  operation.
			 */
			_reduce_vol_read_chunk(req, _write_read_done);
			return;
		}
	}

	lbsize = vol->params.logical_block_size;
	lb_per_chunk = vol->logical_blocks_per_chunk;