Commit daa28975 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Dan Williams

nvdimm/blk: stop using ->queuedata

In preparation for removing queuedata as an argument to
make_request_fn() drop the dependency ->queuedata.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20200508161517.252308-14-hch@lst.deSigned-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent f37b451f
...@@ -165,7 +165,7 @@ static int nsblk_do_bvec(struct nd_namespace_blk *nsblk, ...@@ -165,7 +165,7 @@ static int nsblk_do_bvec(struct nd_namespace_blk *nsblk,
static blk_qc_t nd_blk_make_request(struct request_queue *q, struct bio *bio) static blk_qc_t nd_blk_make_request(struct request_queue *q, struct bio *bio)
{ {
struct bio_integrity_payload *bip; struct bio_integrity_payload *bip;
struct nd_namespace_blk *nsblk; struct nd_namespace_blk *nsblk = bio->bi_disk->private_data;
struct bvec_iter iter; struct bvec_iter iter;
unsigned long start; unsigned long start;
struct bio_vec bvec; struct bio_vec bvec;
...@@ -176,7 +176,6 @@ static blk_qc_t nd_blk_make_request(struct request_queue *q, struct bio *bio) ...@@ -176,7 +176,6 @@ static blk_qc_t nd_blk_make_request(struct request_queue *q, struct bio *bio)
return BLK_QC_T_NONE; return BLK_QC_T_NONE;
bip = bio_integrity(bio); bip = bio_integrity(bio);
nsblk = q->queuedata;
rw = bio_data_dir(bio); rw = bio_data_dir(bio);
do_acct = nd_iostat_start(bio, &start); do_acct = nd_iostat_start(bio, &start);
bio_for_each_segment(bvec, bio, iter) { bio_for_each_segment(bvec, bio, iter) {
...@@ -258,7 +257,6 @@ static int nsblk_attach_disk(struct nd_namespace_blk *nsblk) ...@@ -258,7 +257,6 @@ static int nsblk_attach_disk(struct nd_namespace_blk *nsblk)
blk_queue_max_hw_sectors(q, UINT_MAX); blk_queue_max_hw_sectors(q, UINT_MAX);
blk_queue_logical_block_size(q, nsblk_sector_size(nsblk)); blk_queue_logical_block_size(q, nsblk_sector_size(nsblk));
blk_queue_flag_set(QUEUE_FLAG_NONROT, q); blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
q->queuedata = nsblk;
disk = alloc_disk(0); disk = alloc_disk(0);
if (!disk) if (!disk)
...@@ -268,6 +266,7 @@ static int nsblk_attach_disk(struct nd_namespace_blk *nsblk) ...@@ -268,6 +266,7 @@ static int nsblk_attach_disk(struct nd_namespace_blk *nsblk)
disk->fops = &nd_blk_fops; disk->fops = &nd_blk_fops;
disk->queue = q; disk->queue = q;
disk->flags = GENHD_FL_EXT_DEVT; disk->flags = GENHD_FL_EXT_DEVT;
disk->private_data = nsblk;
nvdimm_namespace_disk_name(&nsblk->common, disk->disk_name); nvdimm_namespace_disk_name(&nsblk->common, disk->disk_name);
if (devm_add_action_or_reset(dev, nd_blk_release_disk, disk)) if (devm_add_action_or_reset(dev, nd_blk_release_disk, disk))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment