Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change handle_io_async return type to void #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions demo_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ static int demo_init_tgt(struct ublksrv_dev *dev, int type, int argc,
return 0;
}

static int demo_handle_io_async(const struct ublksrv_queue *q,
static void demo_handle_io_async(const struct ublksrv_queue *q,
const struct ublk_io_data *data)
{
struct ublksrv_aio *req = ublksrv_aio_alloc_req(aio_ctx, 0);
Expand All @@ -512,8 +512,6 @@ static int demo_handle_io_async(const struct ublksrv_queue *q,
req->fd = backing_fd;
req->id = ublksrv_aio_pid_tag(q->q_id, data->tag);
ublksrv_aio_submit_req(aio_ctx, q, req);

return 0;
}

static void demo_handle_event(const struct ublksrv_queue *q)
Expand Down
4 changes: 1 addition & 3 deletions demo_null.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,12 @@ static int demo_init_tgt(struct ublksrv_dev *dev, int type, int argc,
return 0;
}

static int demo_handle_io_async(const struct ublksrv_queue *q,
static void demo_handle_io_async(const struct ublksrv_queue *q,
const struct ublk_io_data *data)
{
const struct ublksrv_io_desc *iod = data->iod;

ublksrv_complete_io(q, data->tag, iod->nr_sectors << 9);

return 0;
}

void *null_alloc_io_buf(const struct ublksrv_queue *q, int tag, int size)
Expand Down
2 changes: 1 addition & 1 deletion include/ublksrv.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ struct ublksrv_tgt_type {
*
* Required.
*/
int (*handle_io_async)(const struct ublksrv_queue *,
void (*handle_io_async)(const struct ublksrv_queue *,
const struct ublk_io_data *io);

/**
Expand Down
4 changes: 1 addition & 3 deletions nbd/tgt_nbd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ static co_io_job __nbd_handle_recv(const struct ublksrv_queue *q,
co_return;
}

static int nbd_handle_io_async(const struct ublksrv_queue *q,
static void nbd_handle_io_async(const struct ublksrv_queue *q,
const struct ublk_io_data *data)
{
struct ublk_io_tgt *io = __ublk_get_io_tgt_data(data);
Expand All @@ -520,8 +520,6 @@ static int nbd_handle_io_async(const struct ublksrv_queue *q,
q_data->next_chain.push_back(data);
else
io->co = __nbd_handle_io_async(q, data, io);

return 0;
}

/*
Expand Down
3 changes: 1 addition & 2 deletions tgt_loop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ static co_io_job __loop_handle_io_async(const struct ublksrv_queue *q,
}
}

static int loop_handle_io_async(const struct ublksrv_queue *q,
static void loop_handle_io_async(const struct ublksrv_queue *q,
const struct ublk_io_data *data)
{
struct ublk_io_tgt *io = __ublk_get_io_tgt_data(data);
Expand All @@ -413,7 +413,6 @@ static int loop_handle_io_async(const struct ublksrv_queue *q,
} else {
io->co = __loop_handle_io_async(q, data, data->tag);
}
return 0;
}

static void loop_tgt_io_done(const struct ublksrv_queue *q,
Expand Down
4 changes: 1 addition & 3 deletions tgt_null.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,12 @@ static co_io_job __null_handle_io_async(const struct ublksrv_queue *q,
co_return;
}

static int null_handle_io_async(const struct ublksrv_queue *q,
static void null_handle_io_async(const struct ublksrv_queue *q,
const struct ublk_io_data *data)
{
struct ublk_io_tgt *io = __ublk_get_io_tgt_data(data);

io->co = __null_handle_io_async(q, data, data->tag);

return 0;
}

struct ublksrv_tgt_type null_tgt_type = {
Expand Down