Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242244
b: refs/heads/master
c: c94a96a
h: refs/heads/master
v: v3
  • Loading branch information
Vivek Goyal authored and Jens Axboe committed Mar 3, 2011
1 parent b0120d4 commit 5f6e34a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 53f22956effe1c9e7961b8c6e4362ecca5e460b7
refs/heads/master: c94a96ac93b4f5b8d1ff8430b1afa1a25610cf53
16 changes: 15 additions & 1 deletion trunk/block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,11 @@ void blk_put_queue(struct request_queue *q)
kobject_put(&q->kobj);
}

/*
* Note: If a driver supplied the queue lock, it should not zap that lock
* unexpectedly as some queue cleanup components like elevator_exit() and
* blk_throtl_exit() need queue lock.
*/
void blk_cleanup_queue(struct request_queue *q)
{
/*
Expand Down Expand Up @@ -540,6 +545,12 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id)
mutex_init(&q->sysfs_lock);
spin_lock_init(&q->__queue_lock);

/*
* By default initialize queue_lock to internal lock and driver can
* override it later if need be.
*/
q->queue_lock = &q->__queue_lock;

return q;
}
EXPORT_SYMBOL(blk_alloc_queue_node);
Expand Down Expand Up @@ -624,7 +635,10 @@ blk_init_allocated_queue_node(struct request_queue *q, request_fn_proc *rfn,
q->unprep_rq_fn = NULL;
q->unplug_fn = generic_unplug_device;
q->queue_flags = QUEUE_FLAG_DEFAULT;
q->queue_lock = lock;

/* Override internal queue lock with supplied lock pointer */
if (lock)
q->queue_lock = lock;

/*
* This also sets hw/phys segments, boundary and size
Expand Down
7 changes: 0 additions & 7 deletions trunk/block/blk-settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,6 @@ void blk_queue_make_request(struct request_queue *q, make_request_fn *mfn)
blk_set_default_limits(&q->limits);
blk_queue_max_hw_sectors(q, BLK_SAFE_MAX_SECTORS);

/*
* If the caller didn't supply a lock, fall back to our embedded
* per-queue locks
*/
if (!q->queue_lock)
q->queue_lock = &q->__queue_lock;

/*
* by default assume old behaviour and bounce for any highmem page
*/
Expand Down

0 comments on commit 5f6e34a

Please sign in to comment.