diff options
author | Dan Williams <dan.j.williams@intel.com> | 2016-03-19 06:47:43 (GMT) |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2016-04-22 19:26:23 (GMT) |
commit | bd842b8ca7f207b99a5476a8174e62c29a2ff80e (patch) | |
tree | 50365a7b28e6b0796cc8823b63287b531b67d77b /drivers | |
parent | d44077a7cddce18fc8d83194bb4c83a0225f0f40 (diff) | |
download | linux-bd842b8ca7f207b99a5476a8174e62c29a2ff80e.tar.xz |
libnvdimm, pmem: 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/pmem.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index 6fa39f5..2238e3a 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm/pmem.c @@ -135,8 +135,7 @@ static blk_qc_t pmem_make_request(struct request_queue *q, struct bio *bio) unsigned long start; struct bio_vec bvec; struct bvec_iter iter; - struct block_device *bdev = bio->bi_bdev; - struct pmem_device *pmem = bdev->bd_disk->private_data; + struct pmem_device *pmem = q->queuedata; do_acct = nd_iostat_start(bio, &start); bio_for_each_segment(bvec, bio, iter) { @@ -161,7 +160,7 @@ static blk_qc_t pmem_make_request(struct request_queue *q, struct bio *bio) static int pmem_rw_page(struct block_device *bdev, sector_t sector, struct page *page, int rw) { - struct pmem_device *pmem = bdev->bd_disk->private_data; + struct pmem_device *pmem = bdev->bd_queue->queuedata; int rc; rc = pmem_do_bvec(pmem, page, PAGE_SIZE, 0, rw, sector); @@ -183,7 +182,7 @@ static int pmem_rw_page(struct block_device *bdev, sector_t sector, static long pmem_direct_access(struct block_device *bdev, sector_t sector, void __pmem **kaddr, pfn_t *pfn) { - struct pmem_device *pmem = bdev->bd_disk->private_data; + struct pmem_device *pmem = bdev->bd_queue->queuedata; resource_size_t offset = sector * 512 + pmem->data_offset; *kaddr = pmem->virt_addr + offset; @@ -267,6 +266,7 @@ static int pmem_attach_disk(struct device *dev, blk_queue_max_hw_sectors(pmem->pmem_queue, UINT_MAX); blk_queue_bounce_limit(pmem->pmem_queue, BLK_BOUNCE_ANY); queue_flag_set_unlocked(QUEUE_FLAG_NONROT, pmem->pmem_queue); + pmem->pmem_queue->queuedata = pmem; disk = alloc_disk_node(0, nid); if (!disk) { @@ -275,7 +275,6 @@ static int pmem_attach_disk(struct device *dev, } disk->fops = &pmem_fops; - disk->private_data = pmem; disk->queue = pmem->pmem_queue; disk->flags = GENHD_FL_EXT_DEVT; nvdimm_namespace_disk_name(ndns, disk->disk_name); |