2022-06-03 19:15:11 +00:00
|
|
|
/* SPDX-License-Identifier: BSD-3-Clause
|
2018-09-20 16:54:49 +00:00
|
|
|
* Copyright (c) Intel Corporation.
|
|
|
|
* All rights reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef VBDEV_OCF_DOBJ_H
|
|
|
|
#define VBDEV_OCF_DOBJ_H
|
|
|
|
|
|
|
|
#include <ocf/ocf.h>
|
|
|
|
|
|
|
|
#include "ctx.h"
|
|
|
|
#include "data.h"
|
|
|
|
|
|
|
|
/* ocf_io context
|
|
|
|
* It is initialized from io size and offset */
|
|
|
|
struct ocf_io_ctx {
|
|
|
|
struct bdev_ocf_data *data;
|
|
|
|
struct spdk_io_channel *ch;
|
|
|
|
uint32_t offset;
|
|
|
|
int ref;
|
|
|
|
int rq_cnt;
|
|
|
|
int error;
|
2019-05-27 21:10:06 +00:00
|
|
|
bool iovs_allocated;
|
2018-09-20 16:54:49 +00:00
|
|
|
};
|
|
|
|
|
2019-02-13 12:19:39 +00:00
|
|
|
int vbdev_ocf_volume_init(void);
|
|
|
|
void vbdev_ocf_volume_cleanup(void);
|
2018-09-20 16:54:49 +00:00
|
|
|
|
2022-06-22 21:35:04 +00:00
|
|
|
static inline struct ocf_io_ctx *
|
|
|
|
ocf_get_io_ctx(struct ocf_io *io)
|
2018-09-20 16:54:49 +00:00
|
|
|
{
|
2019-02-13 12:19:39 +00:00
|
|
|
return ocf_io_get_priv(io);
|
2018-09-20 16:54:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|