Skip to content

Commit

Permalink
block: remove the disk and queue NULL checks in blkdev_issue_flush
Browse files Browse the repository at this point in the history
Both of these never can be NULL for a live block device.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Christoph Hellwig authored and axboe committed May 22, 2020
1 parent 9398554 commit c81b49d
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions block/blk-flush.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,17 +438,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;
Expand Down

0 comments on commit c81b49d

Please sign in to comment.