Commit 72da9b75 authored by Jim Harris's avatar Jim Harris
Browse files

reduce: use consistent callback names



There are a sequence of operations needed for both
read and write I/O.  For example, on a write I/O,
we may need to do a read, modify the chunk, then
write the data back to disk.

For read I/O, the name of the callback is
_read_read_done - the first "read" indicates the
I/O type, the second "read" indicates the disk read
part of the sequence.

The write I/O steps aren't using this same naming
convention, so change that here.  This will be
important in upcoming patches where we'll be adding
compress/decompress steps into the I/O pipeline -
having a consistent naming strategy will make the code
easier to follow.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: Icd525874918378118d807acdbe5dd42d5be03126

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449258


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent f9ac7dcf
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -888,7 +888,7 @@ _reduce_vol_complete_req(struct spdk_reduce_vol_request *req, int reduce_errno)
}

static void
_write_complete_req(void *_req, int reduce_errno)
_write_write_done(void *_req, int reduce_errno)
{
	struct spdk_reduce_vol_request *req = _req;
	struct spdk_reduce_vol *vol = req->vol;
@@ -1022,7 +1022,7 @@ _write_read_done(void *_req, int reduce_errno)
		buf += req->iov[i].iov_len;
	}

	_reduce_vol_write_chunk(req, _write_complete_req);
	_reduce_vol_write_chunk(req, _write_write_done);
}

static void
@@ -1213,7 +1213,7 @@ _start_writev_request(struct spdk_reduce_vol_request *req)
	if (chunk_offset != lb_per_chunk) {
		memset(buf, 0, (lb_per_chunk - chunk_offset) * lbsize);
	}
	_reduce_vol_write_chunk(req, _write_complete_req);
	_reduce_vol_write_chunk(req, _write_write_done);
}

void