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

Make ublksrv_reap_events_uring public #84

Merged
merged 1 commit into from
Jan 26, 2025
Merged
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
8 changes: 8 additions & 0 deletions include/ublksrv.h
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,14 @@ extern int ublksrv_process_io(const struct ublksrv_queue *q);
* @param res io result
*/
extern int ublksrv_complete_io(const struct ublksrv_queue *q, unsigned tag, int res);

/**
* Reap events received from queue
*
* @param tq the pointer for ublksrv_queue
*/
extern int ublksrv_queue_reap_events(struct ublksrv_queue *tq);

/** @} */ // end of ublksrv_queue group

#ifdef __cplusplus
Expand Down
7 changes: 7 additions & 0 deletions lib/ublksrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,13 @@ static int ublksrv_reap_events_uring(struct io_uring *r)
return count;
}

int ublksrv_queue_reap_events(struct ublksrv_queue *tq)
{
if (tq->ring_ptr)
return ublksrv_reap_events_uring(tq->ring_ptr);
return -1;
}

static void ublksrv_queue_discard_io_pages(struct _ublksrv_queue *q)
{
const struct ublksrv_ctrl_dev *cdev = q->dev->ctrl_dev;
Expand Down