aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorripng <matthewalex@outlook.com>2015-02-16 03:29:10 -0500
committerMoyster <oysterized@gmail.com>2016-09-10 00:38:11 +0200
commit3e3ace204ecb18e8dea794a5fe69ba52da03efb8 (patch)
treecd9860bc6562cf7341b7e16875eebddf95a651c7 /block
parent3847817a4da7c974ecfc406cc22db9156f99faa2 (diff)
block: sioplus Linux 3.10 compatibility update
Signed-off by: Matthew Alex <matthewalex@outlook.com>
Diffstat (limited to 'block')
-rwxr-xr-xblock/sioplus-iosched.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/block/sioplus-iosched.c b/block/sioplus-iosched.c
index 6809cb8a5..10c8eb94a 100755
--- a/block/sioplus-iosched.c
+++ b/block/sioplus-iosched.c
@@ -4,7 +4,7 @@
*
* Copyright (C) 2012 Miguel Boton <mboton@gmail.com>
* (C) 2013, 2014 Boy Petersen <boypetersen@gmail.com>
- *
+ *. 2015 Linux 3.10 compatibility by Matthew Alex <matthewalex@outlook.com>
*
* This algorithm does not do any kind of sorting, as it is aimed for
* aleatory access devices, but it does some basic merging. We try to
@@ -250,15 +250,26 @@ sio_latter_request(struct request_queue *q, struct request *rq)
return list_entry(rq->queuelist.next, struct request, queuelist);
}
-static void *
-sio_init_queue(struct request_queue *q)
+static int sio_init_queue(struct request_queue *q, struct elevator_type *e)
{
struct sio_data *sd;
+ struct elevator_queue *eq;
+
+ eq = elevator_alloc(q, e);
+ if (eq == NULL)
+ return -ENOMEM;
/* Allocate structure */
sd = kmalloc_node(sizeof(*sd), GFP_KERNEL, q->node);
- if (!sd)
- return NULL;
+ if (sd == NULL) {
+ kobject_put(&eq->kobj);
+ return -ENOMEM;
+ }
+ eq->elevator_data = sd;
+
+ spin_lock_irq(q->queue_lock);
+ q->elevator = eq;
+ spin_unlock_irq(q->queue_lock);
/* Initialize fifo lists */
INIT_LIST_HEAD(&sd->fifo_list[SYNC][READ]);
@@ -273,9 +284,8 @@ sio_init_queue(struct request_queue *q)
sd->fifo_expire[ASYNC][READ] = async_read_expire;
sd->fifo_expire[ASYNC][WRITE] = async_write_expire;
sd->fifo_batch = fifo_batch;
- sd->writes_starved = writes_starved;
- return sd;
+ return 0;
}
static void