ocf: fix vbdev_ocf_ctx_data_seek() function

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

Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455412 (master)

(cherry picked from commit efe48d7ca9)
Change-Id: I9583ea8eb21f07a3e9072a9552bed1c077cb7114
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457266
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Vitaliy Mysak 2019-05-22 19:27:18 +00:00 committed by Ben Walker
parent 2c4928649a
commit ce3ffa45ed

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;
}