diff mbox series

use blk_queue_fua() to check QUEUE_FLAG_FUA

Message ID 20211118133350.2716698-1-yili@winhong.com
State New
Headers show
Series use blk_queue_fua() to check QUEUE_FLAG_FUA | expand

Commit Message

Yi Li Nov. 18, 2021, 1:33 p.m. UTC
We alreday has the interface blk_queue_fua() to check QUEUE_FLAG_FUA flag,
so use it.

Signed-off-by: Yi Li <yili@winhong.com>
---
 block/blk-sysfs.c                   | 2 +-
 drivers/target/target_core_iblock.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index cef1f713370b..6a5135b216de 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -544,7 +544,7 @@  static ssize_t queue_wc_store(struct request_queue *q, const char *page,
 
 static ssize_t queue_fua_show(struct request_queue *q, char *page)
 {
-	return sprintf(page, "%u\n", test_bit(QUEUE_FLAG_FUA, &q->queue_flags));
+	return sprintf(page, "%u\n", blk_queue_fua(q));
 }
 
 static ssize_t queue_dax_show(struct request_queue *q, char *page)
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index bf8ae4825a06..683374ddd24d 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -738,7 +738,7 @@  iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
 		 */
 		opf = REQ_OP_WRITE;
 		miter_dir = SG_MITER_TO_SG;
-		if (test_bit(QUEUE_FLAG_FUA, &q->queue_flags)) {
+		if (blk_queue_fua(q)) {
 			if (cmd->se_cmd_flags & SCF_FUA)
 				opf |= REQ_FUA;
 			else if (!test_bit(QUEUE_FLAG_WC, &q->queue_flags))