mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02: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:
committed by
Jens Axboe
parent
a557e82e5a
commit
36d254893a
@@ -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);
|
||||
|
Reference in New Issue
Block a user