forked from Minki/linux
block: remove the bd_queue field from struct block_device
Just use bd_disk->queue instead. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
6b7b181b67
commit
e556f6ba10
@ -59,7 +59,7 @@ EXPORT_SYMBOL(bdev_dax_pgoff);
|
||||
#if IS_ENABLED(CONFIG_FS_DAX)
|
||||
struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev)
|
||||
{
|
||||
if (!blk_queue_dax(bdev->bd_queue))
|
||||
if (!blk_queue_dax(bdev->bd_disk->queue))
|
||||
return NULL;
|
||||
return dax_get_by_host(bdev->bd_disk->disk_name);
|
||||
}
|
||||
|
@ -199,7 +199,7 @@ static int rdevs_init_serial(struct mddev *mddev)
|
||||
static int rdev_need_serial(struct md_rdev *rdev)
|
||||
{
|
||||
return (rdev && rdev->mddev->bitmap_info.max_write_behind > 0 &&
|
||||
rdev->bdev->bd_queue->nr_hw_queues != 1 &&
|
||||
rdev->bdev->bd_disk->queue->nr_hw_queues != 1 &&
|
||||
test_bit(WriteMostly, &rdev->flags));
|
||||
}
|
||||
|
||||
|
@ -467,7 +467,7 @@ static int nvmet_p2pmem_ns_enable(struct nvmet_ns *ns)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!blk_queue_pci_p2pdma(ns->bdev->bd_queue)) {
|
||||
if (!blk_queue_pci_p2pdma(ns->bdev->bd_disk->queue)) {
|
||||
pr_err("peer-to-peer DMA is not supported by the driver of %s\n",
|
||||
ns->device_path);
|
||||
return -EINVAL;
|
||||
|
@ -693,12 +693,12 @@ int bdev_read_page(struct block_device *bdev, sector_t sector,
|
||||
if (!ops->rw_page || bdev_get_integrity(bdev))
|
||||
return result;
|
||||
|
||||
result = blk_queue_enter(bdev->bd_queue, 0);
|
||||
result = blk_queue_enter(bdev->bd_disk->queue, 0);
|
||||
if (result)
|
||||
return result;
|
||||
result = ops->rw_page(bdev, sector + get_start_sect(bdev), page,
|
||||
REQ_OP_READ);
|
||||
blk_queue_exit(bdev->bd_queue);
|
||||
blk_queue_exit(bdev->bd_disk->queue);
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -729,7 +729,7 @@ int bdev_write_page(struct block_device *bdev, sector_t sector,
|
||||
|
||||
if (!ops->rw_page || bdev_get_integrity(bdev))
|
||||
return -EOPNOTSUPP;
|
||||
result = blk_queue_enter(bdev->bd_queue, 0);
|
||||
result = blk_queue_enter(bdev->bd_disk->queue, 0);
|
||||
if (result)
|
||||
return result;
|
||||
|
||||
@ -742,7 +742,7 @@ int bdev_write_page(struct block_device *bdev, sector_t sector,
|
||||
clean_page_buffers(page);
|
||||
unlock_page(page);
|
||||
}
|
||||
blk_queue_exit(bdev->bd_queue);
|
||||
blk_queue_exit(bdev->bd_disk->queue);
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -1568,7 +1568,6 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
|
||||
if (!bdev->bd_openers) {
|
||||
first_open = true;
|
||||
bdev->bd_disk = disk;
|
||||
bdev->bd_queue = disk->queue;
|
||||
bdev->bd_contains = bdev;
|
||||
bdev->bd_partno = partno;
|
||||
|
||||
@ -1589,7 +1588,6 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
|
||||
disk_put_part(bdev->bd_part);
|
||||
bdev->bd_part = NULL;
|
||||
bdev->bd_disk = NULL;
|
||||
bdev->bd_queue = NULL;
|
||||
mutex_unlock(&bdev->bd_mutex);
|
||||
disk_unblock_events(disk);
|
||||
put_disk_and_module(disk);
|
||||
@ -1666,7 +1664,6 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
|
||||
disk_put_part(bdev->bd_part);
|
||||
bdev->bd_disk = NULL;
|
||||
bdev->bd_part = NULL;
|
||||
bdev->bd_queue = NULL;
|
||||
if (bdev != bdev->bd_contains)
|
||||
__blkdev_put(bdev->bd_contains, mode, 1);
|
||||
bdev->bd_contains = NULL;
|
||||
|
@ -1387,8 +1387,8 @@ ssize_t __blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
|
||||
* Attempt to prefetch the pieces we likely need later.
|
||||
*/
|
||||
prefetch(&bdev->bd_disk->part_tbl);
|
||||
prefetch(bdev->bd_queue);
|
||||
prefetch((char *)bdev->bd_queue + SMP_CACHE_BYTES);
|
||||
prefetch(bdev->bd_disk->queue);
|
||||
prefetch((char *)bdev->bd_disk->queue + SMP_CACHE_BYTES);
|
||||
|
||||
return do_blockdev_direct_IO(iocb, inode, bdev, iter, get_block,
|
||||
end_io, submit_io, flags);
|
||||
|
@ -132,5 +132,5 @@ xfs_pwork_guess_datadev_parallelism(
|
||||
* For now we'll go with the most conservative setting possible,
|
||||
* which is two threads for an SSD and 1 thread everywhere else.
|
||||
*/
|
||||
return blk_queue_nonrot(btp->bt_bdev->bd_queue) ? 2 : 1;
|
||||
return blk_queue_nonrot(btp->bt_bdev->bd_disk->queue) ? 2 : 1;
|
||||
}
|
||||
|
@ -39,7 +39,6 @@ struct block_device {
|
||||
unsigned bd_part_count;
|
||||
int bd_invalidated;
|
||||
struct gendisk * bd_disk;
|
||||
struct request_queue * bd_queue;
|
||||
struct backing_dev_info *bd_bdi;
|
||||
struct list_head bd_list;
|
||||
/*
|
||||
|
@ -2929,7 +2929,7 @@ static int claim_swapfile(struct swap_info_struct *p, struct inode *inode)
|
||||
* write only restriction. Hence zoned block devices are not
|
||||
* suitable for swapping. Disallow them here.
|
||||
*/
|
||||
if (blk_queue_is_zoned(p->bdev->bd_queue))
|
||||
if (blk_queue_is_zoned(p->bdev->bd_disk->queue))
|
||||
return -EINVAL;
|
||||
p->flags |= SWP_BLKDEV;
|
||||
} else if (S_ISREG(inode->i_mode)) {
|
||||
|
Loading…
Reference in New Issue
Block a user