aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-settings.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/blk-settings.c')
-rw-r--r--block/blk-settings.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/block/blk-settings.c b/block/blk-settings.c
index a234f4bf1d6f..9b18afcfe925 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -794,6 +794,26 @@ void blk_queue_update_dma_alignment(struct request_queue *q, int mask)
794} 794}
795EXPORT_SYMBOL(blk_queue_update_dma_alignment); 795EXPORT_SYMBOL(blk_queue_update_dma_alignment);
796 796
797/**
798 * blk_queue_flush - configure queue's cache flush capability
799 * @q: the request queue for the device
800 * @flush: 0, REQ_FLUSH or REQ_FLUSH | REQ_FUA
801 *
802 * Tell block layer cache flush capability of @q. If it supports
803 * flushing, REQ_FLUSH should be set. If it supports bypassing
804 * write cache for individual writes, REQ_FUA should be set.
805 */
806void blk_queue_flush(struct request_queue *q, unsigned int flush)
807{
808 WARN_ON_ONCE(flush & ~(REQ_FLUSH | REQ_FUA));
809
810 if (WARN_ON_ONCE(!(flush & REQ_FLUSH) && (flush & REQ_FUA)))
811 flush &= ~REQ_FUA;
812
813 q->flush_flags = flush & (REQ_FLUSH | REQ_FUA);
814}
815EXPORT_SYMBOL_GPL(blk_queue_flush);
816
797static int __init blk_settings_init(void) 817static int __init blk_settings_init(void)
798{ 818{
799 blk_max_low_pfn = max_low_pfn - 1; 819 blk_max_low_pfn = max_low_pfn - 1;