ocf: fix vbdev_ocf_ctx_data_seek() function

Fix instance function for OCF ctx interface.
This function is used for persistent metadata only.

Change-Id: I9583ea8eb21f07a3e9072a9552bed1c077cb7114
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455412
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
This commit is contained in:
Vitaliy Mysak 2019-05-22 19:27:18 +00:00 committed by Jim Harris
parent cca2eab10a
commit efe48d7ca9

View File

@ -225,11 +225,11 @@ vbdev_ocf_ctx_data_seek(ctx_data_t *dst, ctx_data_seek_t seek, uint32_t offset)
switch (seek) {
case ctx_data_seek_begin:
off = MIN(off, d->size);
off = MIN(offset, d->size);
d->seek = off;
break;
case ctx_data_seek_current:
off = MIN(off, d->size - d->seek);
off = MIN(offset, d->size - d->seek);
d->seek += off;
break;
}