From 3a65dfe8c088143c7155cfd36a72f4b0ad2fc4b2 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 4 Nov 2005 08:43:35 +0100 Subject: [BLOCK] Move all core block layer code to new block/ directory drivers/block/ is right now a mix of core and driver parts. Lets move the core parts to a new top level directory. Al will move the fs/ related block parts to block/ next. Signed-off-by: Jens Axboe --- block/noop-iosched.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 block/noop-iosched.c (limited to 'block/noop-iosched.c') diff --git a/block/noop-iosched.c b/block/noop-iosched.c new file mode 100644 index 000000000000..e54f006e7e60 --- /dev/null +++ b/block/noop-iosched.c @@ -0,0 +1,46 @@ +/* + * elevator noop + */ +#include +#include +#include +#include +#include + +static void elevator_noop_add_request(request_queue_t *q, struct request *rq) +{ + rq->flags |= REQ_NOMERGE; + elv_dispatch_add_tail(q, rq); +} + +static int elevator_noop_dispatch(request_queue_t *q, int force) +{ + return 0; +} + +static struct elevator_type elevator_noop = { + .ops = { + .elevator_dispatch_fn = elevator_noop_dispatch, + .elevator_add_req_fn = elevator_noop_add_request, + }, + .elevator_name = "noop", + .elevator_owner = THIS_MODULE, +}; + +static int __init noop_init(void) +{ + return elv_register(&elevator_noop); +} + +static void __exit noop_exit(void) +{ + elv_unregister(&elevator_noop); +} + +module_init(noop_init); +module_exit(noop_exit); + + +MODULE_AUTHOR("Jens Axboe"); +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("No-op IO scheduler"); -- cgit v1.2.3