Skip to content

Commit 6ec26b8

Browse files
Christoph Hellwigdjbw
authored andcommitted
nvdimm/pmem: stop using ->queuedata
In preparation for removing queuedata as an argument to make_request_fn() drop the dependency ->queuedata. Signed-off-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dan Williams <[email protected]>
1 parent 5713bcc commit 6ec26b8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/nvdimm/pmem.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ static blk_qc_t pmem_make_request(struct request_queue *q, struct bio *bio)
196196
unsigned long start;
197197
struct bio_vec bvec;
198198
struct bvec_iter iter;
199-
struct pmem_device *pmem = q->queuedata;
199+
struct pmem_device *pmem = bio->bi_disk->private_data;
200200
struct nd_region *nd_region = to_region(pmem);
201201

202202
if (bio->bi_opf & REQ_PREFLUSH)
@@ -231,7 +231,7 @@ static blk_qc_t pmem_make_request(struct request_queue *q, struct bio *bio)
231231
static int pmem_rw_page(struct block_device *bdev, sector_t sector,
232232
struct page *page, unsigned int op)
233233
{
234-
struct pmem_device *pmem = bdev->bd_queue->queuedata;
234+
struct pmem_device *pmem = bdev->bd_disk->private_data;
235235
blk_status_t rc;
236236

237237
if (op_is_write(op))
@@ -464,7 +464,6 @@ static int pmem_attach_disk(struct device *dev,
464464
blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
465465
if (pmem->pfn_flags & PFN_MAP)
466466
blk_queue_flag_set(QUEUE_FLAG_DAX, q);
467-
q->queuedata = pmem;
468467

469468
disk = alloc_disk_node(0, nid);
470469
if (!disk)
@@ -474,6 +473,7 @@ static int pmem_attach_disk(struct device *dev,
474473
disk->fops = &pmem_fops;
475474
disk->queue = q;
476475
disk->flags = GENHD_FL_EXT_DEVT;
476+
disk->private_data = pmem;
477477
disk->queue->backing_dev_info->capabilities |= BDI_CAP_SYNCHRONOUS_IO;
478478
nvdimm_namespace_disk_name(ndns, disk->disk_name);
479479
set_capacity(disk, (pmem->size - pmem->pfn_pad - pmem->data_offset)

0 commit comments

Comments
 (0)