Linux Kernel
3.7.1
|
#include <aio.h>
Data Fields | |
struct list_head | ki_run_list |
unsigned long | ki_flags |
int | ki_users |
unsigned | ki_key |
struct file * | ki_filp |
struct kioctx * | ki_ctx |
int(* | ki_cancel )(struct kiocb *, struct io_event *) |
ssize_t(* | ki_retry )(struct kiocb *) |
void(* | ki_dtor )(struct kiocb *) |
union { | |
void __user * user | |
struct task_struct * tsk | |
} | ki_obj |
__u64 | ki_user_data |
loff_t | ki_pos |
void * | private |
unsigned short | ki_opcode |
size_t | ki_nbytes |
char __user * | ki_buf |
size_t | ki_left |
struct iovec | ki_inline_vec |
struct iovec * | ki_iovec |
unsigned long | ki_nr_segs |
unsigned long | ki_cur_seg |
struct list_head | ki_list |
struct list_head | ki_batch |
struct eventfd_ctx * | ki_eventfd |
ki_retry - iocb forward progress callback : The kiocb struct to advance by performing an operation.
This callback is called when the AIO core wants a given AIO operation to make forward progress. The kiocb argument describes the operation that is to be performed. As the operation proceeds, perhaps partially, ki_retry is expected to update the kiocb with progress made. Typically ki_retry is set in the AIO core and it itself calls file_operations helpers.
ki_retry's return value determines when the AIO operation is completed and an event is generated in the AIO event ring. Except the special return values described below, the value that is returned from ki_retry is transferred directly into the completion ring as the operation's resulting status. Once this has happened ki_retry MUST NOT reference the kiocb pointer again.
If ki_retry returns -EIOCBQUEUED it has made a promise that aio_complete() will be called on the kiocb pointer in the future. The AIO core will not ask the method again – ki_retry must ensure forward progress. aio_complete() must be called once and only once in the future, multiple calls may result in undefined behaviour.
If ki_retry returns -EIOCBRETRY it has made a promise that kick_iocb() will be called on the kiocb pointer in the future. This may happen through generic helpers that associate kiocb->ki_wait with a wait queue head that ki_retry uses via current->io_wait. It can also happen with custom tracking and manual calls to kick_iocb(), though that is discouraged. In either case, kick_iocb() must be called once and only once. ki_retry must ensure forward progress, the AIO core will wait indefinitely for kick_iocb() to be called.
struct eventfd_ctx* ki_eventfd |
union { ... } ki_obj |
struct task_struct* tsk |