bdev/compress: small fix-up to 2MB patch

For completion context, the first src mbuf 'userdata' field
is filled in. The wrong index was being used to set this which
would never cause a problem because only the first src mbuf is
used.  Also when an extra src mbuf is added we weren't setting
userdata which again isn't a real problem but for consistency
I'd like to set it since all other src mbufs have it set.

Change-Id: Iac32a9a37502a95ce0f997375b6c75a42bc1651f
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466150
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
paul luse 2019-08-23 12:45:27 -04:00 committed by Ben Walker
parent f12ac17189
commit 493ce2cbbf

View File

@ -489,7 +489,7 @@ _compress_operation(struct spdk_reduce_backing_dev *backing_dev, struct iovec *s
current_src_base = src_iovs[iov_index].iov_base;
total_length += src_iovs[iov_index].iov_len;
assert(src_mbufs[mbuf_index] != NULL);
src_mbufs[iov_index]->userdata = reduce_cb_arg;
src_mbufs[mbuf_index]->userdata = reduce_cb_arg;
updated_length = src_iovs[iov_index].iov_len;
phys_addr = spdk_vtophys((void *)current_src_base, &updated_length);
@ -515,6 +515,7 @@ _compress_operation(struct spdk_reduce_backing_dev *backing_dev, struct iovec *s
}
src_mbuf_total++;
mbuf_index++;
src_mbufs[mbuf_index]->userdata = reduce_cb_arg;
current_src_base += updated_length;
phys_addr = spdk_vtophys((void *)current_src_base, &remainder);
/* assert we don't cross another */