Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Fields
kiocb Struct Reference

#include <aio.h>

Data Fields

struct list_head ki_run_list
unsigned long ki_flags
int ki_users
unsigned ki_key
struct fileki_filp
struct kioctxki_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
__u64 ki_user_data
loff_t ki_pos
unsigned short ki_opcode
size_t ki_nbytes
char __userki_buf
size_t ki_left
struct iovec ki_inline_vec
struct iovecki_iovec
unsigned long ki_nr_segs
unsigned long ki_cur_seg
struct list_head ki_list
struct list_head ki_batch
struct eventfd_ctxki_eventfd

Detailed Description

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.

Definition at line 87 of file aio.h.

Field Documentation

struct list_head ki_batch

Definition at line 120 of file aio.h.

char __user* ki_buf

Definition at line 111 of file aio.h.

int(* ki_cancel)(struct kiocb *, struct io_event *)

Definition at line 95 of file aio.h.

struct kioctx* ki_ctx

Definition at line 94 of file aio.h.

unsigned long ki_cur_seg

Definition at line 116 of file aio.h.

void(* ki_dtor)(struct kiocb *)

Definition at line 97 of file aio.h.

struct eventfd_ctx* ki_eventfd

Definition at line 126 of file aio.h.

struct file* ki_filp

Definition at line 93 of file aio.h.

unsigned long ki_flags

Definition at line 89 of file aio.h.

struct iovec ki_inline_vec

Definition at line 113 of file aio.h.

struct iovec* ki_iovec

Definition at line 114 of file aio.h.

unsigned ki_key

Definition at line 91 of file aio.h.

size_t ki_left

Definition at line 112 of file aio.h.

struct list_head ki_list

Definition at line 118 of file aio.h.

size_t ki_nbytes

Definition at line 110 of file aio.h.

unsigned long ki_nr_segs

Definition at line 115 of file aio.h.

union { ... } ki_obj
unsigned short ki_opcode

Definition at line 109 of file aio.h.

loff_t ki_pos

Definition at line 105 of file aio.h.

ssize_t(* ki_retry)(struct kiocb *)

Definition at line 96 of file aio.h.

struct list_head ki_run_list

Definition at line 88 of file aio.h.

__u64 ki_user_data

Definition at line 104 of file aio.h.

int ki_users

Definition at line 90 of file aio.h.

void* private

Definition at line 107 of file aio.h.

Definition at line 101 of file aio.h.

Definition at line 100 of file aio.h.

The documentation for this struct was generated from the following file: