aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorMatthew Wilcox <matthew.r.wilcox@intel.com>2011-12-20 11:04:12 -0500
committerMatthew Wilcox <matthew.r.wilcox@intel.com>2012-01-10 14:49:18 -0500
commit040a93b52a9eee8177ebaf2ba0ee0f9f518d1bf8 (patch)
treebe1f319048580f40c2634bca46e2840d721a32f4 /drivers/block
parentc2f5b65020869215814df03c3941dac9436f99fb (diff)
NVMe: Change get_nvmeq to take a dev instead of a namespace
Upcoming patches require calling get_nvmeq when we don't have a namespace. Some callers already have the device in a local variable anyway. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/nvme.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/block/nvme.c b/drivers/block/nvme.c
index 4724655a6ebf..aa2fd66aabd6 100644
--- a/drivers/block/nvme.c
+++ b/drivers/block/nvme.c
@@ -257,9 +257,9 @@ static void *cancel_cmdid(struct nvme_queue *nvmeq, int cmdid,
257 return ctx; 257 return ctx;
258} 258}
259 259
260static struct nvme_queue *get_nvmeq(struct nvme_ns *ns) 260static struct nvme_queue *get_nvmeq(struct nvme_dev *dev)
261{ 261{
262 return ns->dev->queues[get_cpu() + 1]; 262 return dev->queues[get_cpu() + 1];
263} 263}
264 264
265static void put_nvmeq(struct nvme_queue *nvmeq) 265static void put_nvmeq(struct nvme_queue *nvmeq)
@@ -606,7 +606,7 @@ static int nvme_submit_bio_queue(struct nvme_queue *nvmeq, struct nvme_ns *ns,
606static int nvme_make_request(struct request_queue *q, struct bio *bio) 606static int nvme_make_request(struct request_queue *q, struct bio *bio)
607{ 607{
608 struct nvme_ns *ns = q->queuedata; 608 struct nvme_ns *ns = q->queuedata;
609 struct nvme_queue *nvmeq = get_nvmeq(ns); 609 struct nvme_queue *nvmeq = get_nvmeq(ns->dev);
610 int result = -EBUSY; 610 int result = -EBUSY;
611 611
612 spin_lock_irq(&nvmeq->q_lock); 612 spin_lock_irq(&nvmeq->q_lock);
@@ -1103,7 +1103,7 @@ static int nvme_submit_io(struct nvme_ns *ns, struct nvme_user_io __user *uio)
1103 /* XXX: metadata */ 1103 /* XXX: metadata */
1104 prps = nvme_setup_prps(dev, &c.common, sg, &length, GFP_KERNEL); 1104 prps = nvme_setup_prps(dev, &c.common, sg, &length, GFP_KERNEL);
1105 1105
1106 nvmeq = get_nvmeq(ns); 1106 nvmeq = get_nvmeq(dev);
1107 /* 1107 /*
1108 * Since nvme_submit_sync_cmd sleeps, we can't keep preemption 1108 * Since nvme_submit_sync_cmd sleeps, we can't keep preemption
1109 * disabled. We may be preempted at any point, and be rescheduled 1109 * disabled. We may be preempted at any point, and be rescheduled