mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
block: add a bdev_stable_writes helper
Add a helper to check the stable writes flag based on the block_device instead of having to poke into the block layer internal request_queue. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Link: https://lore.kernel.org/r/20220415045258.199825-15-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
a557e82e5a
commit
36d254893a
4 changed files with 9 additions and 5 deletions
|
@ -1330,6 +1330,12 @@ static inline bool bdev_nonrot(struct block_device *bdev)
|
|||
return blk_queue_nonrot(bdev_get_queue(bdev));
|
||||
}
|
||||
|
||||
static inline bool bdev_stable_writes(struct block_device *bdev)
|
||||
{
|
||||
return test_bit(QUEUE_FLAG_STABLE_WRITES,
|
||||
&bdev_get_queue(bdev)->queue_flags);
|
||||
}
|
||||
|
||||
static inline bool bdev_write_cache(struct block_device *bdev)
|
||||
{
|
||||
return test_bit(QUEUE_FLAG_WC, &bdev_get_queue(bdev)->queue_flags);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue