From 72da9b7562841b78ac5b6869b7735b22dfd138c5 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Fri, 22 Mar 2019 13:40:37 -0700 Subject: [PATCH] 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: Jim Harris Change-Id: Icd525874918378118d807acdbe5dd42d5be03126 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449258 Tested-by: SPDK CI Jenkins Reviewed-by: Changpeng Liu Reviewed-by: Paul Luse Reviewed-by: Shuhei Matsumoto --- lib/reduce/reduce.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/reduce/reduce.c b/lib/reduce/reduce.c index 04c417e36..51985526e 100644 --- a/lib/reduce/reduce.c +++ b/lib/reduce/reduce.c @@ -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