diff options
author | Christoph Hellwig <hch@lst.de> | 2022-01-27 10:05:49 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-02-02 17:50:00 +0300 |
commit | aa8dcccaf32bfdc09f2aff089d5d60c37da5b7b5 (patch) | |
tree | 47905396b491e167950ec5c95d1d2bdeb3c72e6e /include | |
parent | b1f866b013e6e5583f2f0bf4a61d13eddb9a1799 (diff) | |
download | linux-aa8dcccaf32bfdc09f2aff089d5d60c37da5b7b5.tar.xz |
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')
-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); |