summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2016-03-18 23:45:45 -0700
committerDan Williams <dan.j.williams@intel.com>2016-04-22 12:26:22 -0700
commitd44077a7cddce18fc8d83194bb4c83a0225f0f40 (patch)
tree7fe3e7302bc2b84160d9623f451619f603dedbbb /drivers
parentd29cee120eb890027c69f5fe7cce8bd6a663900a (diff)
downloadop-kernel-dev-d44077a7cddce18fc8d83194bb4c83a0225f0f40.zip
op-kernel-dev-d44077a7cddce18fc8d83194bb4c83a0225f0f40.tar.gz
libnvdimm, blk: use ->queuedata for driver private data
Save a pointer chase by storing the driver private data in the request_queue rather than the gendisk. Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/nvdimm/blk.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/nvdimm/blk.c b/drivers/nvdimm/blk.c
index 27ff32a..c8635b3 100644
--- a/drivers/nvdimm/blk.c
+++ b/drivers/nvdimm/blk.c
@@ -159,8 +159,6 @@ static int nd_blk_do_bvec(struct nd_blk_device *blk_dev,
static blk_qc_t nd_blk_make_request(struct request_queue *q, struct bio *bio)
{
- struct block_device *bdev = bio->bi_bdev;
- struct gendisk *disk = bdev->bd_disk;
struct bio_integrity_payload *bip;
struct nd_blk_device *blk_dev;
struct bvec_iter iter;
@@ -181,7 +179,7 @@ static blk_qc_t nd_blk_make_request(struct request_queue *q, struct bio *bio)
}
bip = bio_integrity(bio);
- blk_dev = disk->private_data;
+ blk_dev = q->queuedata;
rw = bio_data_dir(bio);
do_acct = nd_iostat_start(bio, &start);
bio_for_each_segment(bvec, bio, iter) {
@@ -268,6 +266,7 @@ static int nd_blk_attach_disk(struct device *dev,
blk_queue_bounce_limit(q, BLK_BOUNCE_ANY);
blk_queue_logical_block_size(q, blk_dev->sector_size);
queue_flag_set_unlocked(QUEUE_FLAG_NONROT, q);
+ q->queuedata = blk_dev;
disk = alloc_disk(0);
if (!disk)
@@ -280,7 +279,6 @@ static int nd_blk_attach_disk(struct device *dev,
disk->driverfs_dev = &ndns->dev;
disk->first_minor = 0;
disk->fops = &nd_blk_fops;
- disk->private_data = blk_dev;
disk->queue = q;
disk->flags = GENHD_FL_EXT_DEVT;
nvdimm_namespace_disk_name(ndns, disk->disk_name);
OpenPOWER on IntegriCloud