Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1363815 > unrolled thread
| Started by | Dan Williams <dan.j.williams@intel.com> |
|---|---|
| First post | 2016-03-24 02:30 +0100 |
| Last post | 2016-03-24 13:10 +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.
[PATCH 07/13] libnvdimm, pmem: use ->queuedata for driver private data Dan Williams <dan.j.williams@intel.com> - 2016-03-24 02:30 +0100
Re: [PATCH 07/13] libnvdimm, pmem: use ->queuedata for driver private data Johannes Thumshirn <jthumshirn@suse.de> - 2016-03-24 13:10 +0100
| From | Dan Williams <dan.j.williams@intel.com> |
|---|---|
| Date | 2016-03-24 02:30 +0100 |
| Subject | [PATCH 07/13] libnvdimm, pmem: use ->queuedata for driver private data |
| Message-ID | <rg2g2-3vC-17@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/pmem.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
index 1e492c66d105..ff336dd26064 100644
--- a/drivers/nvdimm/pmem.c
+++ b/drivers/nvdimm/pmem.c
@@ -121,8 +121,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) {
@@ -147,7 +146,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_CACHE_SIZE, 0, rw, sector);
@@ -169,7 +168,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;
@@ -253,6 +252,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) {
@@ -261,7 +261,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);
[toc] | [next] | [standalone]
| From | Johannes Thumshirn <jthumshirn@suse.de> |
|---|---|
| Date | 2016-03-24 13:10 +0100 |
| Subject | Re: [PATCH 07/13] libnvdimm, pmem: use ->queuedata for driver private data |
| Message-ID | <rgcfn-2s2-1@gated-at.bofh.it> |
| In reply to | #1363815 |
On Mittwoch, 23. März 2016 18:25:58 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