]>
Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* |
2 | * An async IO implementation for Linux | |
3 | * Written by Benjamin LaHaise <[email protected]> | |
4 | * | |
5 | * Implements an efficient asynchronous io interface. | |
6 | * | |
7 | * Copyright 2000, 2001, 2002 Red Hat, Inc. All Rights Reserved. | |
8 | * | |
9 | * See ../COPYING for licensing terms. | |
10 | */ | |
11 | #include <linux/kernel.h> | |
12 | #include <linux/init.h> | |
13 | #include <linux/errno.h> | |
14 | #include <linux/time.h> | |
15 | #include <linux/aio_abi.h> | |
16 | #include <linux/module.h> | |
17 | #include <linux/syscalls.h> | |
b9d128f1 | 18 | #include <linux/backing-dev.h> |
027445c3 | 19 | #include <linux/uio.h> |
1da177e4 LT |
20 | |
21 | #define DEBUG 0 | |
22 | ||
23 | #include <linux/sched.h> | |
24 | #include <linux/fs.h> | |
25 | #include <linux/file.h> | |
26 | #include <linux/mm.h> | |
27 | #include <linux/mman.h> | |
3d2d827f | 28 | #include <linux/mmu_context.h> |
1da177e4 LT |
29 | #include <linux/slab.h> |
30 | #include <linux/timer.h> | |
31 | #include <linux/aio.h> | |
32 | #include <linux/highmem.h> | |
33 | #include <linux/workqueue.h> | |
34 | #include <linux/security.h> | |
9c3060be | 35 | #include <linux/eventfd.h> |
cfb1e33e | 36 | #include <linux/blkdev.h> |
9d85cba7 | 37 | #include <linux/compat.h> |
1da177e4 LT |
38 | |
39 | #include <asm/kmap_types.h> | |
40 | #include <asm/uaccess.h> | |
1da177e4 LT |
41 | |
42 | #if DEBUG > 1 | |
43 | #define dprintk printk | |
44 | #else | |
45 | #define dprintk(x...) do { ; } while (0) | |
46 | #endif | |
47 | ||
1da177e4 | 48 | /*------ sysctl variables----*/ |
d55b5fda ZB |
49 | static DEFINE_SPINLOCK(aio_nr_lock); |
50 | unsigned long aio_nr; /* current system wide number of aio requests */ | |
51 | unsigned long aio_max_nr = 0x10000; /* system wide maximum number of aio requests */ | |
1da177e4 LT |
52 | /*----end sysctl variables---*/ |
53 | ||
e18b890b CL |
54 | static struct kmem_cache *kiocb_cachep; |
55 | static struct kmem_cache *kioctx_cachep; | |
1da177e4 LT |
56 | |
57 | static struct workqueue_struct *aio_wq; | |
58 | ||
59 | /* Used for rare fput completion. */ | |
65f27f38 DH |
60 | static void aio_fput_routine(struct work_struct *); |
61 | static DECLARE_WORK(fput_work, aio_fput_routine); | |
1da177e4 LT |
62 | |
63 | static DEFINE_SPINLOCK(fput_lock); | |
25ee7e38 | 64 | static LIST_HEAD(fput_head); |
1da177e4 | 65 | |
65f27f38 | 66 | static void aio_kick_handler(struct work_struct *); |