Remove ocf_io_get()
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
This commit is contained in:
parent
a9718eeab1
commit
85513332d7
@ -45,15 +45,6 @@ typedef void (*ocf_handle_io_t)(ocf_io_t io, void *opaque);
|
|||||||
*/
|
*/
|
||||||
typedef void (*ocf_end_io_t)(ocf_io_t io, void *priv1, void *priv2, int error);
|
typedef void (*ocf_end_io_t)(ocf_io_t io, void *priv1, void *priv2, int error);
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Increase reference counter in OCF IO
|
|
||||||
*
|
|
||||||
* @note Wrapper for get IO operation
|
|
||||||
*
|
|
||||||
* @param[in] io OCF IO
|
|
||||||
*/
|
|
||||||
void ocf_io_get(ocf_io_t io);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Decrease reference counter in OCF IO
|
* @brief Decrease reference counter in OCF IO
|
||||||
*
|
*
|
||||||
|
@ -213,8 +213,7 @@ static void ocf_req_complete(struct ocf_request *req, int error)
|
|||||||
|
|
||||||
dec_counter_if_req_was_dirty(req);
|
dec_counter_if_req_was_dirty(req);
|
||||||
|
|
||||||
/* Invalidate OCF IO, it is not valid after completion */
|
ocf_req_put(req);
|
||||||
ocf_io_put(req);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline ocf_req_cache_mode_t _ocf_core_req_resolve_fast_mode(
|
static inline ocf_req_cache_mode_t _ocf_core_req_resolve_fast_mode(
|
||||||
@ -281,7 +280,7 @@ static void ocf_core_volume_submit_io(ocf_io_t io)
|
|||||||
|
|
||||||
req->complete = ocf_req_complete;
|
req->complete = ocf_req_complete;
|
||||||
|
|
||||||
ocf_io_get(io);
|
ocf_req_get(req);
|
||||||
|
|
||||||
if (unlikely(req->d2c)) {
|
if (unlikely(req->d2c)) {
|
||||||
ocf_core_update_stats(core, io);
|
ocf_core_update_stats(core, io);
|
||||||
@ -323,7 +322,7 @@ static void ocf_core_volume_submit_io(ocf_io_t io)
|
|||||||
|
|
||||||
err:
|
err:
|
||||||
ocf_io_end_func(io, ret);
|
ocf_io_end_func(io, ret);
|
||||||
ocf_io_put(req);
|
ocf_req_put(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ocf_core_volume_submit_flush(ocf_io_t io)
|
static void ocf_core_volume_submit_flush(ocf_io_t io)
|
||||||
@ -349,7 +348,7 @@ static void ocf_core_volume_submit_flush(ocf_io_t io)
|
|||||||
|
|
||||||
req->complete = ocf_req_complete;
|
req->complete = ocf_req_complete;
|
||||||
|
|
||||||
ocf_io_get(io);
|
ocf_req_get(req);
|
||||||
|
|
||||||
if (unlikely(req->d2c)) {
|
if (unlikely(req->d2c)) {
|
||||||
ocf_d2c_flush_fast(req);
|
ocf_d2c_flush_fast(req);
|
||||||
@ -387,7 +386,7 @@ static void ocf_core_volume_submit_discard(ocf_io_t io)
|
|||||||
|
|
||||||
req->complete = ocf_req_complete;
|
req->complete = ocf_req_complete;
|
||||||
|
|
||||||
ocf_io_get(io);
|
ocf_req_get(req);
|
||||||
|
|
||||||
if (unlikely(req->d2c)) {
|
if (unlikely(req->d2c)) {
|
||||||
ocf_d2c_discard_fast(req);
|
ocf_d2c_discard_fast(req);
|
||||||
|
@ -125,13 +125,6 @@ uint32_t ocf_io_get_offset(ocf_io_t io)
|
|||||||
return req->offset;
|
return req->offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ocf_io_get(ocf_io_t io)
|
|
||||||
{
|
|
||||||
struct ocf_request *req = ocf_io_to_req(io);
|
|
||||||
|
|
||||||
env_atomic_inc_return(&req->io.ref_count);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ocf_io_put(ocf_io_t io)
|
void ocf_io_put(ocf_io_t io)
|
||||||
{
|
{
|
||||||
struct ocf_request *req = ocf_io_to_req(io);
|
struct ocf_request *req = ocf_io_to_req(io);
|
||||||
|
@ -81,9 +81,6 @@ class Io(Structure):
|
|||||||
def put(self):
|
def put(self):
|
||||||
OcfLib.getInstance().ocf_io_put(byref(self))
|
OcfLib.getInstance().ocf_io_put(byref(self))
|
||||||
|
|
||||||
def get(self):
|
|
||||||
OcfLib.getInstance().ocf_io_get(byref(self))
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@END
|
@END
|
||||||
def c_end(io, priv1, priv2, err):
|
def c_end(io, priv1, priv2, err):
|
||||||
|
Loading…
Reference in New Issue
Block a user