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 <hch@lst.de> Link: https://lore.kernel.org/r/20200508161517.252308-16-hch@lst.de Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
parent
5713bcc3fd
commit
6ec26b8b2d
|
@ -196,7 +196,7 @@ static blk_qc_t pmem_make_request(struct request_queue *q, struct bio *bio)
|
||||||
unsigned long start;
|
unsigned long start;
|
||||||
struct bio_vec bvec;
|
struct bio_vec bvec;
|
||||||
struct bvec_iter iter;
|
struct bvec_iter iter;
|
||||||
struct pmem_device *pmem = q->queuedata;
|
struct pmem_device *pmem = bio->bi_disk->private_data;
|
||||||
struct nd_region *nd_region = to_region(pmem);
|
struct nd_region *nd_region = to_region(pmem);
|
||||||
|
|
||||||
if (bio->bi_opf & REQ_PREFLUSH)
|
if (bio->bi_opf & REQ_PREFLUSH)
|
||||||
|
@ -231,7 +231,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,
|
static int pmem_rw_page(struct block_device *bdev, sector_t sector,
|
||||||
struct page *page, unsigned int op)
|
struct page *page, unsigned int op)
|
||||||
{
|
{
|
||||||
struct pmem_device *pmem = bdev->bd_queue->queuedata;
|
struct pmem_device *pmem = bdev->bd_disk->private_data;
|
||||||
blk_status_t rc;
|
blk_status_t rc;
|
||||||
|
|
||||||
if (op_is_write(op))
|
if (op_is_write(op))
|
||||||
|
@ -464,7 +464,6 @@ static int pmem_attach_disk(struct device *dev,
|
||||||
blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
|
blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
|
||||||
if (pmem->pfn_flags & PFN_MAP)
|
if (pmem->pfn_flags & PFN_MAP)
|
||||||
blk_queue_flag_set(QUEUE_FLAG_DAX, q);
|
blk_queue_flag_set(QUEUE_FLAG_DAX, q);
|
||||||
q->queuedata = pmem;
|
|
||||||
|
|
||||||
disk = alloc_disk_node(0, nid);
|
disk = alloc_disk_node(0, nid);
|
||||||
if (!disk)
|
if (!disk)
|
||||||
|
@ -474,6 +473,7 @@ static int pmem_attach_disk(struct device *dev,
|
||||||
disk->fops = &pmem_fops;
|
disk->fops = &pmem_fops;
|
||||||
disk->queue = q;
|
disk->queue = q;
|
||||||
disk->flags = GENHD_FL_EXT_DEVT;
|
disk->flags = GENHD_FL_EXT_DEVT;
|
||||||
|
disk->private_data = pmem;
|
||||||
disk->queue->backing_dev_info->capabilities |= BDI_CAP_SYNCHRONOUS_IO;
|
disk->queue->backing_dev_info->capabilities |= BDI_CAP_SYNCHRONOUS_IO;
|
||||||
nvdimm_namespace_disk_name(ndns, disk->disk_name);
|
nvdimm_namespace_disk_name(ndns, disk->disk_name);
|
||||||
set_capacity(disk, (pmem->size - pmem->pfn_pad - pmem->data_offset)
|
set_capacity(disk, (pmem->size - pmem->pfn_pad - pmem->data_offset)
|
||||||
|
|
Loading…
Reference in New Issue