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.
Showing the changes to include/linux (1 of 3 files). Show all
Unified · Split
| @@ -50,6 +50,9 @@ struct blk_stat_callback; · 49 unmodified lines | ||
| 50 | 50 | /* Must be consistent with blk_mq_poll_stats_bkt() */ |
| 51 | 51 | #define BLK_MQ_POLL_STATS_BKTS 16 |
| 52 | 52 | |
| 53 | +/* Doing classic polling */ | |
| 54 | +#define BLK_MQ_POLL_CLASSIC -1 | |
| 55 | + | |
| 53 | 56 | /* |
| 54 | 57 | * Maximum number of blkcg policies allowed to be registered concurrently. |
| 55 | 58 | * Defined here to simplify include dependency. |