Message ID | 20200508161517.252308-2-hch@lst.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [01/15] nfblock: use gendisk private_data | expand |
Hi Christoph, On Fri, May 8, 2020 at 6:16 PM Christoph Hellwig <hch@lst.de> wrote: > Signed-off-by: Christoph Hellwig <hch@lst.de> Thanks for your patch! > --- a/arch/m68k/emu/nfblock.c > +++ b/arch/m68k/emu/nfblock.c > @@ -61,7 +61,7 @@ struct nfhd_device { > > static blk_qc_t nfhd_make_request(struct request_queue *queue, struct bio *bio) > { > - struct nfhd_device *dev = queue->queuedata; > + struct nfhd_device *dev = bio->bi_disk->private_data; > struct bio_vec bvec; > struct bvec_iter iter; > int dir, len, shift; > @@ -122,7 +122,6 @@ static int __init nfhd_init_one(int id, u32 blocks, u32 bsize) > if (dev->queue == NULL) > goto free_dev; > > - dev->queue->queuedata = dev; > blk_queue_logical_block_size(dev->queue, bsize); > > dev->disk = alloc_disk(16); > @@ -136,6 +135,7 @@ static int __init nfhd_init_one(int id, u32 blocks, u32 bsize) > sprintf(dev->disk->disk_name, "nfhd%u", dev_id); > set_capacity(dev->disk, (sector_t)blocks * (bsize / 512)); > dev->disk->queue = dev->queue; > + dev->disk->private_data = dev; This is already set above, just before the quoted sprintf() call. > > add_disk(dev->disk); Gr{oetje,eeting}s, Geert
diff --git a/arch/m68k/emu/nfblock.c b/arch/m68k/emu/nfblock.c index c3a630440512e..5c6f04b00e866 100644 --- a/arch/m68k/emu/nfblock.c +++ b/arch/m68k/emu/nfblock.c @@ -61,7 +61,7 @@ struct nfhd_device { static blk_qc_t nfhd_make_request(struct request_queue *queue, struct bio *bio) { - struct nfhd_device *dev = queue->queuedata; + struct nfhd_device *dev = bio->bi_disk->private_data; struct bio_vec bvec; struct bvec_iter iter; int dir, len, shift; @@ -122,7 +122,6 @@ static int __init nfhd_init_one(int id, u32 blocks, u32 bsize) if (dev->queue == NULL) goto free_dev; - dev->queue->queuedata = dev; blk_queue_logical_block_size(dev->queue, bsize); dev->disk = alloc_disk(16); @@ -136,6 +135,7 @@ static int __init nfhd_init_one(int id, u32 blocks, u32 bsize) sprintf(dev->disk->disk_name, "nfhd%u", dev_id); set_capacity(dev->disk, (sector_t)blocks * (bsize / 512)); dev->disk->queue = dev->queue; + dev->disk->private_data = dev; add_disk(dev->disk);
Signed-off-by: Christoph Hellwig <hch@lst.de> --- arch/m68k/emu/nfblock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)