]> git.baikalelectronics.ru Git - kernel.git/commit
block: add BLK_MQ_POLL_CLASSIC for hybrid poll and return EINVAL for unexpected value
authorYufen Yu <yuyufen@huawei.com>
Mon, 18 Mar 2019 14:44:41 +0000 (22:44 +0800)
committerJens Axboe <axboe@kernel.dk>
Wed, 20 Mar 2019 20:02:07 +0000 (14:02 -0600)
commit49271d8a69c643c86e12790e9e7baefd85dbc8c7
tree953360a0c9964a71527205e3f427269c80d0f10f
parent39f7cf14e94d5471d9830d811a20a298a7a6847e
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>
block/blk-mq.c
block/blk-sysfs.c
include/linux/blkdev.h