From: Christoph Hellwig <hch@lst.de>
To: axboe@kernel.dk
Cc: linux-block@vger.kernel.org
Subject: [PATCH 2/2] block: remove the disk and queue NULL checks in blkdev_issue_flush
Date: Wed, 13 May 2020 14:36:01 +0200 [thread overview]
Message-ID: <20200513123601.2465370-3-hch@lst.de> (raw)
In-Reply-To: <20200513123601.2465370-1-hch@lst.de>
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(-)
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;
--
2.26.2
next prev parent reply other threads:[~2020-05-13 12:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-13 12:35 small blkdev_issue_flush cleanups Christoph Hellwig
2020-05-13 12:36 ` [PATCH 1/2] block: remove the error_sector argument to blkdev_issue_flush Christoph Hellwig
2020-05-16 4:14 ` Chaitanya Kulkarni
2020-05-13 12:36 ` Christoph Hellwig [this message]
2020-05-16 4:25 ` [PATCH 2/2] block: remove the disk and queue NULL checks in blkdev_issue_flush Chaitanya Kulkarni
2020-05-21 14:35 ` small blkdev_issue_flush cleanups Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200513123601.2465370-3-hch@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).