diff options
author | Dan Williams <dan.j.williams@intel.com> | 2016-03-19 02:45:45 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2016-04-22 15:26:22 -0400 |
commit | d44077a7cddce18fc8d83194bb4c83a0225f0f40 (patch) | |
tree | 7fe3e7302bc2b84160d9623f451619f603dedbbb | |
parent | d29cee120eb890027c69f5fe7cce8bd6a663900a (diff) |
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>
-rw-r--r-- | drivers/nvdimm/blk.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/nvdimm/blk.c b/drivers/nvdimm/blk.c index 27ff32a5e9cf..c8635b3d88a8 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, | |||
159 | 159 | ||
160 | static blk_qc_t nd_blk_make_request(struct request_queue *q, struct bio *bio) | 160 | static blk_qc_t nd_blk_make_request(struct request_queue *q, struct bio *bio) |
161 | { | 161 | { |
162 | struct block_device *bdev = bio->bi_bdev; | ||
163 | struct gendisk *disk = bdev->bd_disk; | ||
164 | struct bio_integrity_payload *bip; | 162 | struct bio_integrity_payload *bip; |
165 | struct nd_blk_device *blk_dev; | 163 | struct nd_blk_device *blk_dev; |
166 | struct bvec_iter iter; | 164 | struct bvec_iter iter; |
@@ -181,7 +179,7 @@ static blk_qc_t nd_blk_make_request(struct request_queue *q, struct bio *bio) | |||
181 | } | 179 | } |
182 | 180 | ||
183 | bip = bio_integrity(bio); | 181 | bip = bio_integrity(bio); |
184 | blk_dev = disk->private_data; | 182 | blk_dev = q->queuedata; |
185 | rw = bio_data_dir(bio); | 183 | rw = bio_data_dir(bio); |
186 | do_acct = nd_iostat_start(bio, &start); | 184 | do_acct = nd_iostat_start(bio, &start); |
187 | bio_for_each_segment(bvec, bio, iter) { | 185 | bio_for_each_segment(bvec, bio, iter) { |
@@ -268,6 +266,7 @@ static int nd_blk_attach_disk(struct device *dev, | |||
268 | blk_queue_bounce_limit(q, BLK_BOUNCE_ANY); | 266 | blk_queue_bounce_limit(q, BLK_BOUNCE_ANY); |
269 | blk_queue_logical_block_size(q, blk_dev->sector_size); | 267 | blk_queue_logical_block_size(q, blk_dev->sector_size); |
270 | queue_flag_set_unlocked(QUEUE_FLAG_NONROT, q); | 268 | queue_flag_set_unlocked(QUEUE_FLAG_NONROT, q); |
269 | q->queuedata = blk_dev; | ||
271 | 270 | ||
272 | disk = alloc_disk(0); | 271 | disk = alloc_disk(0); |
273 | if (!disk) | 272 | if (!disk) |
@@ -280,7 +279,6 @@ static int nd_blk_attach_disk(struct device *dev, | |||
280 | disk->driverfs_dev = &ndns->dev; | 279 | disk->driverfs_dev = &ndns->dev; |
281 | disk->first_minor = 0; | 280 | disk->first_minor = 0; |
282 | disk->fops = &nd_blk_fops; | 281 | disk->fops = &nd_blk_fops; |
283 | disk->private_data = blk_dev; | ||
284 | disk->queue = q; | 282 | disk->queue = q; |
285 | disk->flags = GENHD_FL_EXT_DEVT; | 283 | disk->flags = GENHD_FL_EXT_DEVT; |
286 | nvdimm_namespace_disk_name(ndns, disk->disk_name); | 284 | nvdimm_namespace_disk_name(ndns, disk->disk_name); |