From: Jeffy Chen <jeffy.chen@rock-chips.com>
To: linux-kernel@vger.kernel.org, axboe@fb.com, hch@lst.de
Cc: Jeffy Chen <jeffy.chen@rock-chips.com>,
Shaun Tancheff <shaun.tancheff@seagate.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
NeilBrown <neilb@suse.com>, Jens Axboe <axboe@kernel.dk>,
Shaohua Li <shli@fb.com>, Omar Sandoval <osandov@fb.com>
Subject: [PATCH v2 1/2] block: Treat all read ops as synchronous
Date: Fri, 13 Oct 2017 11:45:06 +0800 [thread overview]
Message-ID: <20171013034507.30823-1-jeffy.chen@rock-chips.com> (raw)
The comment for op_is_sync() says "Reads are always treated as
synchronous", but it only checks for REQ_OP_READ.
Use op_is_write() to detect read ops and treat them as synchronous.
Fixes: aebf526b53ae ("block: fold cmd_type into the REQ_OP_ space")
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---
Changes in v2:
Rewrite commit message.
include/linux/blk_types.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 3385c89f402e..b6a71c2eec36 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -288,8 +288,7 @@ static inline bool op_is_flush(unsigned int op)
*/
static inline bool op_is_sync(unsigned int op)
{
- return (op & REQ_OP_MASK) == REQ_OP_READ ||
- (op & (REQ_SYNC | REQ_FUA | REQ_PREFLUSH));
+ return !op_is_write(op) || (op & (REQ_SYNC | REQ_FUA | REQ_PREFLUSH));
}
typedef unsigned int blk_qc_t;
--
2.11.0
next reply other threads:[~2017-10-13 3:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-13 3:45 Jeffy Chen [this message]
2017-10-13 3:45 ` [PATCH v2 2/2] block/cfq: Fix memory leak without CFQ_GROUP_IOSCHED Jeffy Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171013034507.30823-1-jeffy.chen@rock-chips.com \
--to=jeffy.chen@rock-chips.com \
--cc=axboe@fb.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=neilb@suse.com \
--cc=osandov@fb.com \
--cc=shaun.tancheff@seagate.com \
--cc=shli@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®