diff options
| author | Paul Reioux <reioux@gmail.com> | 2014-11-23 13:12:06 -0600 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2016-09-13 13:13:52 +0200 |
| commit | de56c5c4fc5cf56003ec50e76c4566189a5954ba (patch) | |
| tree | 591352f8b6edb8fa0a5837c42ed80cc623ec526d | |
| parent | a435b17b1c4c8c08e048a54e83a1c173490db330 (diff) | |
FIOPS: forward port for use on 3.10 Linux
Change-Id: I1ae7f50feda51b2aacb15c7b632cd38937b1edb5
Signed-off-by: Paul Reioux <reioux@gmail.com>
| -rw-r--r-- | block/fiops-iosched.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/block/fiops-iosched.c b/block/fiops-iosched.c index 671b1d331..7a3f66550 100644 --- a/block/fiops-iosched.c +++ b/block/fiops-iosched.c @@ -467,11 +467,11 @@ static void fiops_init_prio_data(struct fiops_ioc *cic) cic->wl_type = fiops_wl_type(task_nice_ioclass(tsk)); break; case IOPRIO_CLASS_RT: - cic->ioprio = task_ioprio(ioc); + cic->ioprio = IOPRIO_PRIO_DATA(ioc->ioprio); cic->wl_type = fiops_wl_type(IOPRIO_CLASS_RT); break; case IOPRIO_CLASS_BE: - cic->ioprio = task_ioprio(ioc); + cic->ioprio = IOPRIO_PRIO_DATA(ioc->ioprio); cic->wl_type = fiops_wl_type(IOPRIO_CLASS_BE); break; case IOPRIO_CLASS_IDLE: @@ -614,16 +614,27 @@ static void fiops_kick_queue(struct work_struct *work) spin_unlock_irq(q->queue_lock); } -static void *fiops_init_queue(struct request_queue *q) +static int fiops_init_queue(struct request_queue *q, struct elevator_type *e) { struct fiops_data *fiopsd; int i; + struct elevator_queue *eq; + + eq = elevator_alloc(q, e); + if (!eq) + return -ENOMEM; fiopsd = kzalloc_node(sizeof(*fiopsd), GFP_KERNEL, q->node); - if (!fiopsd) - return NULL; + if (!fiopsd) { + kobject_put(&eq->kobj); + return -ENOMEM; + } + eq->elevator_data = fiopsd; fiopsd->queue = q; + spin_lock_irq(q->queue_lock); + q->elevator = eq; + spin_unlock_irq(q->queue_lock); for (i = IDLE_WORKLOAD; i <= RT_WORKLOAD; i++) fiopsd->service_tree[i] = FIOPS_RB_ROOT; @@ -635,7 +646,7 @@ static void *fiops_init_queue(struct request_queue *q) fiopsd->sync_scale = VIOS_SYNC_SCALE; fiopsd->async_scale = VIOS_ASYNC_SCALE; - return fiopsd; + return 0; } static void fiops_init_icq(struct io_cq *icq) |
