Merge branch 'upstream' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
[linux-2.6] / drivers / block / noop-iosched.c
1 /*
2  * elevator noop
3  */
4 #include <linux/blkdev.h>
5 #include <linux/elevator.h>
6 #include <linux/bio.h>
7 #include <linux/module.h>
8 #include <linux/init.h>
9
10 static void elevator_noop_add_request(request_queue_t *q, struct request *rq)
11 {
12         elv_dispatch_add_tail(q, rq);
13 }
14
15 static int elevator_noop_dispatch(request_queue_t *q, int force)
16 {
17         return 0;
18 }
19
20 static struct elevator_type elevator_noop = {
21         .ops = {
22                 .elevator_dispatch_fn           = elevator_noop_dispatch,
23                 .elevator_add_req_fn            = elevator_noop_add_request,
24         },
25         .elevator_name = "noop",
26         .elevator_owner = THIS_MODULE,
27 };
28
29 static int __init noop_init(void)
30 {
31         return elv_register(&elevator_noop);
32 }
33
34 static void __exit noop_exit(void)
35 {
36         elv_unregister(&elevator_noop);
37 }
38
39 module_init(noop_init);
40 module_exit(noop_exit);
41
42
43 MODULE_AUTHOR("Jens Axboe");
44 MODULE_LICENSE("GPL");
45 MODULE_DESCRIPTION("No-op IO scheduler");