Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1363823 > unrolled thread

[PATCH 06/13] libnvdimm, blk: use ->queuedata for driver private data

Started byDan Williams <dan.j.williams@intel.com>
First post2016-03-24 02:30 +0100
Last post2016-03-24 13:00 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 06/13] libnvdimm,  blk: use ->queuedata for driver private data Dan Williams <dan.j.williams@intel.com> - 2016-03-24 02:30 +0100
    Re: [PATCH 06/13] libnvdimm, blk: use ->queuedata for driver private data Johannes Thumshirn <jthumshirn@suse.de> - 2016-03-24 13:00 +0100

#1363823 — [PATCH 06/13] libnvdimm, blk: use ->queuedata for driver private data

FromDan Williams <dan.j.williams@intel.com>
Date2016-03-24 02:30 +0100
Subject[PATCH 06/13] libnvdimm, blk: use ->queuedata for driver private data
Message-ID<rg2g3-3vC-29@gated-at.bofh.it>
Save a pointer chase by storing the driver private data in the
request_queue rather than the gendisk.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 drivers/nvdimm/blk.c |    6 ++----
 1 file 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,
 
 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);

[toc] | [next] | [standalone]


#1364105 — Re: [PATCH 06/13] libnvdimm, blk: use ->queuedata for driver private data

FromJohannes Thumshirn <jthumshirn@suse.de>
Date2016-03-24 13:00 +0100
SubjectRe: [PATCH 06/13] libnvdimm, blk: use ->queuedata for driver private data
Message-ID<rgc5J-28s-17@gated-at.bofh.it>
In reply to#1363823
On Mittwoch, 23. März 2016 18:25:52 CET Dan Williams wrote:
> Save a pointer chase by storing the driver private data in the
> request_queue rather than the gendisk.
> 
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web