From: Christoph Hellwig Date: Mon, 21 Nov 2016 15:18:18 +0000 (+0100) Subject: block: clear all of bi_opf in bio_set_op_attrs X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=93c5bdf7ab71bbdae27f8f51fa175e06f000d69d;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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: Christoph Hellwig Signed-off-by: Jens Axboe --- diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 4d0044d09984..f57458a6a93b 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -207,8 +207,11 @@ enum req_flag_bits { ((req)->cmd_flags & REQ_OP_MASK) /* obsolete, don't use in new code */ -#define bio_set_op_attrs(bio, op, op_flags) \ - ((bio)->bi_opf |= (op | op_flags)) +static inline void bio_set_op_attrs(struct bio *bio, unsigned op, + unsigned op_flags) +{ + bio->bi_opf = op | op_flags; +} static inline bool op_is_write(unsigned int op) {