diff mbox series

[2/2] block: remove the disk and queue NULL checks in blkdev_issue_flush

Message ID 20200513123601.2465370-3-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series [1/2] block: remove the error_sector argument to blkdev_issue_flush | expand

Commit Message

Christoph Hellwig May 13, 2020, 12:36 p.m. UTC
Both of these never can be NULL for a live block device.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/blk-flush.c | 8 --------
 1 file changed, 8 deletions(-)

Comments

Chaitanya Kulkarni May 16, 2020, 4:25 a.m. UTC | #1
On 05/13/2020 05:36 AM, Christoph Hellwig wrote:
> Both of these never can be NULL for a live block device.
>
> Signed-off-by: Christoph Hellwig<hch@lst.de>

Looks good.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
diff mbox series

Patch

diff --git a/block/blk-flush.c b/block/blk-flush.c
index dc23d5177f9bb..d5f0ed740e79f 100644
--- a/block/blk-flush.c
+++ b/block/blk-flush.c
@@ -439,17 +439,9 @@  void blk_insert_flush(struct request *rq)
  */
 int blkdev_issue_flush(struct block_device *bdev, gfp_t gfp_mask)
 {
-	struct request_queue *q;
 	struct bio *bio;
 	int ret = 0;
 
-	if (bdev->bd_disk == NULL)
-		return -ENXIO;
-
-	q = bdev_get_queue(bdev);
-	if (!q)
-		return -ENXIO;
-
 	bio = bio_alloc(gfp_mask, 0);
 	bio_set_dev(bio, bdev);
 	bio->bi_opf = REQ_OP_WRITE | REQ_PREFLUSH;