diff options
author | Yufen Yu <yuyufen@huawei.com> | 2019-03-18 15:44:41 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-03-20 21:02:07 +0100 |
commit | 29ece8b4354f8c5eaee798a3d8a1b356efee426f (patch) | |
tree | 953360a0c9964a71527205e3f427269c80d0f10f /include | |
parent | blk-mq: remove unused 'nr_expired' from blk_mq_hw_ctx (diff) | |
download | linux-29ece8b4354f8c5eaee798a3d8a1b356efee426f.tar.xz linux-29ece8b4354f8c5eaee798a3d8a1b356efee426f.zip |
block: add BLK_MQ_POLL_CLASSIC for hybrid poll and return EINVAL for unexpected value
For q->poll_nsec == -1, means doing classic poll, not hybrid poll.
We introduce a new flag BLK_MQ_POLL_CLASSIC to replace -1, which
may make code much easier to read.
Additionally, since val is an int obtained with kstrtoint(), val can be
a negative value other than -1, so return -EINVAL for that case.
Thanks to Damien Le Moal for some good suggestion.
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Yufen Yu <yuyufen@huawei.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/blkdev.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 0de92b29f589..5c58a3b2bf00 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -50,6 +50,9 @@ struct blk_stat_callback; /* Must be consistent with blk_mq_poll_stats_bkt() */ #define BLK_MQ_POLL_STATS_BKTS 16 +/* Doing classic polling */ +#define BLK_MQ_POLL_CLASSIC -1 + /* * Maximum number of blkcg policies allowed to be registered concurrently. * Defined here to simplify include dependency. |