diff options
| author | 2022-01-27 08:05:49 +0100 | |
|---|---|---|
| committer | 2022-02-02 07:50:00 -0700 | |
| commit | aa8dcccaf32bfdc09f2aff089d5d60c37da5b7b5 (patch) | |
| tree | 47905396b491e167950ec5c95d1d2bdeb3c72e6e /include/linux | |
| parent | block: remove blk_needs_flush_plug (diff) | |
| download | linux-dev-aa8dcccaf32bfdc09f2aff089d5d60c37da5b7b5.tar.xz linux-dev-aa8dcccaf32bfdc09f2aff089d5d60c37da5b7b5.zip | |
block: check that there is a plug in blk_flush_plug
Rename blk_flush_plug to __blk_flush_plug and add a wrapper that includes
the NULL check instead of open coding that check everywhere.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Link: https://lore.kernel.org/r/20220127070549.1377856-2-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/blkdev.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index f902a1c2fac0..654163d3b903 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -1053,7 +1053,12 @@ extern void blk_start_plug(struct blk_plug *); extern void blk_start_plug_nr_ios(struct blk_plug *, unsigned short); extern void blk_finish_plug(struct blk_plug *); -void blk_flush_plug(struct blk_plug *plug, bool from_schedule); +void __blk_flush_plug(struct blk_plug *plug, bool from_schedule); +static inline void blk_flush_plug(struct blk_plug *plug, bool async) +{ + if (plug) + __blk_flush_plug(plug, async); +} int blkdev_issue_flush(struct block_device *bdev); long nr_blockdev_pages(void); |
