summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2008-02-01 11:34:49 +0100
committerJens Axboe <jens.axboe@oracle.com>2008-02-01 11:34:49 +0100
commit3bc217ffe6774e7971d6a7ce6350ce806ebab044 (patch)
treeb1ccad14a0c23f12248092feb867d2e311db59f0 /block
parent8bdd3f8a6993fef2f364aca6e1a59559405773a2 (diff)
downloadop-kernel-dev-3bc217ffe6774e7971d6a7ce6350ce806ebab044.zip
op-kernel-dev-3bc217ffe6774e7971d6a7ce6350ce806ebab044.tar.gz
block: kill swap_io_context()
It blindly copies everything in the io_context, including the lock. That doesn't work so well for either lock ordering or lockdep. There seems zero point in swapping io contexts on a request to request merge, so the best point of action is to just remove it. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block')
-rw-r--r--block/as-iosched.c14
-rw-r--r--block/blk-ioc.c9
2 files changed, 0 insertions, 23 deletions
diff --git a/block/as-iosched.c b/block/as-iosched.c
index 612d640..8c39467 100644
--- a/block/as-iosched.c
+++ b/block/as-iosched.c
@@ -1268,22 +1268,8 @@ static void as_merged_requests(struct request_queue *q, struct request *req,
*/
if (!list_empty(&req->queuelist) && !list_empty(&next->queuelist)) {
if (time_before(rq_fifo_time(next), rq_fifo_time(req))) {
- struct io_context *rioc = RQ_IOC(req);
- struct io_context *nioc = RQ_IOC(next);
-
list_move(&req->queuelist, &next->queuelist);
rq_set_fifo_time(req, rq_fifo_time(next));
- /*
- * Don't copy here but swap, because when anext is
- * removed below, it must contain the unused context
- */
- if (rioc != nioc) {
- double_spin_lock(&rioc->lock, &nioc->lock,
- rioc < nioc);
- swap_io_context(&rioc, &nioc);
- double_spin_unlock(&rioc->lock, &nioc->lock,
- rioc < nioc);
- }
}
}
diff --git a/block/blk-ioc.c b/block/blk-ioc.c
index 6d16755..80245dc 100644
--- a/block/blk-ioc.c
+++ b/block/blk-ioc.c
@@ -176,15 +176,6 @@ void copy_io_context(struct io_context **pdst, struct io_context **psrc)
}
EXPORT_SYMBOL(copy_io_context);
-void swap_io_context(struct io_context **ioc1, struct io_context **ioc2)
-{
- struct io_context *temp;
- temp = *ioc1;
- *ioc1 = *ioc2;
- *ioc2 = temp;
-}
-EXPORT_SYMBOL(swap_io_context);
-
int __init blk_ioc_init(void)
{
iocontext_cachep = kmem_cache_create("blkdev_ioc",
OpenPOWER on IntegriCloud