]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
block: kill swap_io_context()
authorJens Axboe <jens.axboe@oracle.com>
Fri, 1 Feb 2008 10:34:49 +0000 (11:34 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 1 Feb 2008 10:34:49 +0000 (11:34 +0100)
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>
block/as-iosched.c
block/blk-ioc.c
include/linux/blkdev.h

index 612d640963006a45a677571b93aa2e182a8e5d09..8c3946787dbbbaedd3381a195ab7851e84ec8272 100644 (file)
@@ -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);
-                       }
                }
        }
 
index 6d1675508eb5d20c8367992fa125dc3cad3a06d8..80245dc30c75798d33089b99e14e80a746b8d50f 100644 (file)
@@ -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",
index cf170391c47471579b56477940ea86ec364e9cf4..90392a9d7a9c782f3745db67b89b03bd67ba588c 100644 (file)
@@ -39,7 +39,6 @@ void exit_io_context(void);
 struct io_context *get_io_context(gfp_t gfp_flags, int node);
 struct io_context *alloc_io_context(gfp_t gfp_flags, int node);
 void copy_io_context(struct io_context **pdst, struct io_context **psrc);
-void swap_io_context(struct io_context **ioc1, struct io_context **ioc2);
 
 struct request;
 typedef void (rq_end_io_fn)(struct request *, int);