On Fri, 2019-03-08 at 10:40 -0700, Keith Busch wrote: +AD4 Drivers may need to know the state of their requets. Hi Keith, What makes you think that drivers should be able to check the state of their requests? Please elaborate. +AD4 diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h +AD4 index faed9d9eb84c..db113aee48bb 100644 +AD4 --- a/include/linux/blkdev.h +AD4 +-+-+- b/include/linux/blkdev.h +AD4 +AEAAQA -241,6 +-241,15 +AEAAQA struct request +AHs +AD4 struct request +ACo-next+AF8-rq+ADs +AD4 +AH0AOw +AD4 +AD4 +-/+ACoAKg +AD4 +- +ACo blk+AF8-mq+AF8-rq+AF8-state() - read the current MQ+AF8-RQ+AF8AKg state of a request +AD4 +- +ACo +AEA-rq: target request. +AD4 +- +ACo-/ +AD4 +-static inline enum mq+AF8-rq+AF8-state blk+AF8-mq+AF8-rq+AF8-state(struct request +ACo-rq) +AD4 +-+AHs +AD4 +- return READ+AF8-ONCE(rq-+AD4-state)+ADs +AD4 +-+AH0 Please also explain how drivers can use this function without triggering a race condition with the code that modifies rq-+AD4-state. Thanks, Bart.