History

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.

Yufen Yu committed 7 years ago

Commit 29ece8b1 parent 9496c013 files · +12 −7Browse files

Showing the changes to include/linux (1 of 3 files). Show all

Unified · Split

include/linux/blkdev.h+3−0
@@ -50,6 +50,9 @@ struct blk_stat_callback; · 49 unmodified lines
50/* Must be consistent with blk_mq_poll_stats_bkt() */50/* Must be consistent with blk_mq_poll_stats_bkt() */
51#define BLK_MQ_POLL_STATS_BKTS 1651#define BLK_MQ_POLL_STATS_BKTS 16
52 52
53/* Doing classic polling */
54#define BLK_MQ_POLL_CLASSIC -1
55
53/*56/*
54 * Maximum number of blkcg policies allowed to be registered concurrently.57 * Maximum number of blkcg policies allowed to be registered concurrently.
55 * Defined here to simplify include dependency.58 * Defined here to simplify include dependency.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t