提交 93c5bdf7 编写于 作者: C Christoph Hellwig 提交者: Jens Axboe

block: clear all of bi_opf in bio_set_op_attrs

Since commit 87374179 ("block: add a proper block layer data direction
encoding") we only or the new op and flags into bi_opf in bio_set_op_attrs
instead of clearing the old value.  I've not seen any breakage with the
new behavior, but it seems dangerous.

Also convert it to an inline function to make the argument passing
safer.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NJens Axboe <axboe@fb.com>
上级 5a8b187c
...@@ -207,8 +207,11 @@ enum req_flag_bits { ...@@ -207,8 +207,11 @@ enum req_flag_bits {
((req)->cmd_flags & REQ_OP_MASK) ((req)->cmd_flags & REQ_OP_MASK)
/* obsolete, don't use in new code */ /* obsolete, don't use in new code */
#define bio_set_op_attrs(bio, op, op_flags) \ static inline void bio_set_op_attrs(struct bio *bio, unsigned op,
((bio)->bi_opf |= (op | op_flags)) unsigned op_flags)
{
bio->bi_opf = op | op_flags;
}
static inline bool op_is_write(unsigned int op) static inline bool op_is_write(unsigned int op)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册