You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user