落盘机制修改
This commit is contained in:
@@ -11,18 +11,26 @@
|
||||
#include <sys/uio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
typedef enum { TASK_READ, TASK_WRITE } task_op_t;
|
||||
typedef enum { TASK_READ, TASK_WRITE, TASK_FSYNC } task_op_t;
|
||||
|
||||
struct task;
|
||||
typedef void (*task_destroy_cb_t)(struct task *t, void *arg);
|
||||
|
||||
typedef struct task {
|
||||
task_op_t op;
|
||||
int fd;
|
||||
off_t off;
|
||||
unsigned fsync_flags;
|
||||
unsigned sqe_flags;
|
||||
|
||||
int res;
|
||||
_Atomic int done;
|
||||
|
||||
struct iovec *iovs;
|
||||
int iovcnt;
|
||||
int free_iov_bases;
|
||||
task_destroy_cb_t on_destroy;
|
||||
void *on_destroy_arg;
|
||||
|
||||
struct task *next;
|
||||
} task_t;
|
||||
@@ -73,6 +81,10 @@ int iouring_init(iouring_ctx_t *ctx, unsigned entries);
|
||||
void iouring_shutdown(iouring_ctx_t *ctx);
|
||||
|
||||
task_t *submit_write(iouring_ctx_t *ctx, int fd, void **bufs, size_t *lens, int count, off_t off);
|
||||
task_t *submit_write_ref(iouring_ctx_t *ctx, int fd, void **bufs, size_t *lens, int count, off_t off,
|
||||
int free_iov_bases, task_destroy_cb_t on_destroy, void *on_destroy_arg);
|
||||
task_t *submit_fsync_ref(iouring_ctx_t *ctx, int fd, int worker_id, int drain,
|
||||
task_destroy_cb_t on_destroy, void *on_destroy_arg);
|
||||
int uring_task_complete(iouring_ctx_t *ctx);
|
||||
void cleanup_finished_iouring_tasks(iouring_ctx_t *ctx);
|
||||
void iouring_profile_dump(iouring_ctx_t *ctx);
|
||||
|
||||
Reference in New Issue
Block a user