Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
aio.c File Reference
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/time.h>
#include <linux/aio_abi.h>
#include <linux/export.h>
#include <linux/syscalls.h>
#include <linux/backing-dev.h>
#include <linux/uio.h>
#include <linux/sched.h>
#include <linux/fs.h>
#include <linux/file.h>
#include <linux/mm.h>
#include <linux/mman.h>
#include <linux/mmu_context.h>
#include <linux/slab.h>
#include <linux/timer.h>
#include <linux/aio.h>
#include <linux/highmem.h>
#include <linux/workqueue.h>
#include <linux/security.h>
#include <linux/eventfd.h>
#include <linux/blkdev.h>
#include <linux/compat.h>
#include <asm/kmap_types.h>
#include <asm/uaccess.h>

Go to the source code of this file.

Data Structures

struct  kiocb_batch
 
struct  aio_timeout
 

Macros

#define DEBUG   0
 
#define dprintk(x...)   do { ; } while (0)
 
#define AIO_EVENTS_PER_PAGE   (PAGE_SIZE / sizeof(struct io_event))
 
#define AIO_EVENTS_FIRST_PAGE   ((PAGE_SIZE - sizeof(struct aio_ring)) / sizeof(struct io_event))
 
#define AIO_EVENTS_OFFSET   (AIO_EVENTS_PER_PAGE - AIO_EVENTS_FIRST_PAGE)
 
#define aio_ring_event(info, nr)
 
#define put_aio_ring_event(event)
 
#define KIOCB_BATCH_SIZE   32L
 

Functions

 __initcall (aio_setup)
 
ssize_t wait_on_sync_kiocb (struct kiocb *iocb)
 
 EXPORT_SYMBOL (wait_on_sync_kiocb)
 
void exit_aio (struct mm_struct *mm)
 
int aio_put_req (struct kiocb *req)
 
 EXPORT_SYMBOL (aio_put_req)
 
void kick_iocb (struct kiocb *iocb)
 
 EXPORT_SYMBOL (kick_iocb)
 
int aio_complete (struct kiocb *iocb, long res, long res2)
 
 EXPORT_SYMBOL (aio_complete)
 
 SYSCALL_DEFINE2 (io_setup, unsigned, nr_events, aio_context_t __user *, ctxp)
 
 SYSCALL_DEFINE1 (io_destroy, aio_context_t, ctx)
 
long do_io_submit (aio_context_t ctx_id, long nr, struct iocb __user *__user *iocbpp, bool compat)
 
 SYSCALL_DEFINE3 (io_submit, aio_context_t, ctx_id, long, nr, struct iocb __user *__user *, iocbpp)
 
 SYSCALL_DEFINE3 (io_cancel, aio_context_t, ctx_id, struct iocb __user *, iocb, struct io_event __user *, result)
 
 SYSCALL_DEFINE5 (io_getevents, aio_context_t, ctx_id, long, min_nr, long, nr, struct io_event __user *, events, struct timespec __user *, timeout)
 

Variables

unsigned long aio_nr
 
unsigned long aio_max_nr = 0x10000
 

Macro Definition Documentation

#define AIO_EVENTS_FIRST_PAGE   ((PAGE_SIZE - sizeof(struct aio_ring)) / sizeof(struct io_event))

Definition at line 173 of file aio.c.

#define AIO_EVENTS_OFFSET   (AIO_EVENTS_PER_PAGE - AIO_EVENTS_FIRST_PAGE)

Definition at line 174 of file aio.c.

#define AIO_EVENTS_PER_PAGE   (PAGE_SIZE / sizeof(struct io_event))

Definition at line 172 of file aio.c.

#define aio_ring_event (   info,
  nr 
)
Value:
({ \
unsigned pos = (nr) + AIO_EVENTS_OFFSET; \
struct io_event *__event; \
__event = kmap_atomic( \
(info)->ring_pages[pos / AIO_EVENTS_PER_PAGE]); \
__event += pos % AIO_EVENTS_PER_PAGE; \
__event; \
})

Definition at line 176 of file aio.c.

#define DEBUG   0

Definition at line 21 of file aio.c.

#define dprintk (   x...)    do { ; } while (0)

Definition at line 45 of file aio.c.

#define KIOCB_BATCH_SIZE   32L

Definition at line 436 of file aio.c.

#define put_aio_ring_event (   event)
Value:
do { \
struct io_event *__event = (event); \
(void)__event; \
kunmap_atomic((void *)((unsigned long)__event & PAGE_MASK)); \
} while(0)

Definition at line 185 of file aio.c.

Function Documentation

__initcall ( aio_setup  )
int aio_complete ( struct kiocb iocb,
long  res,
long  res2 
)

Definition at line 892 of file aio.c.

int aio_put_req ( struct kiocb req)

Definition at line 576 of file aio.c.

long do_io_submit ( aio_context_t  ctx_id,
long  nr,
struct iocb __user *__user iocbpp,
bool  compat 
)

Definition at line 1610 of file aio.c.

void exit_aio ( struct mm_struct mm)

Definition at line 369 of file aio.c.

EXPORT_SYMBOL ( wait_on_sync_kiocb  )
EXPORT_SYMBOL ( aio_put_req  )
EXPORT_SYMBOL ( kick_iocb  )
EXPORT_SYMBOL ( aio_complete  )
void kick_iocb ( struct kiocb iocb)

Definition at line 873 of file aio.c.

SYSCALL_DEFINE1 ( io_destroy  ,
aio_context_t  ,
ctx   
)

Definition at line 1267 of file aio.c.

SYSCALL_DEFINE2 ( io_setup  ,
unsigned  ,
nr_events  ,
aio_context_t __user ,
ctxp   
)

Definition at line 1231 of file aio.c.

SYSCALL_DEFINE3 ( io_submit  ,
aio_context_t  ,
ctx_id  ,
long  ,
nr  ,
struct iocb __user *__user ,
iocbpp   
)

Definition at line 1679 of file aio.c.

SYSCALL_DEFINE3 ( io_cancel  ,
aio_context_t  ,
ctx_id  ,
struct iocb __user ,
iocb  ,
struct io_event __user ,
result   
)

Definition at line 1714 of file aio.c.

SYSCALL_DEFINE5 ( io_getevents  ,
aio_context_t  ,
ctx_id  ,
long  ,
min_nr  ,
long  ,
nr  ,
struct io_event __user ,
events  ,
struct timespec __user ,
timeout   
)

Definition at line 1777 of file aio.c.

ssize_t wait_on_sync_kiocb ( struct kiocb iocb)

Definition at line 349 of file aio.c.

Variable Documentation

unsigned long aio_max_nr = 0x10000

Definition at line 51 of file aio.c.

unsigned long aio_nr

Definition at line 50 of file aio.c.